关于什么是梯度下降,请看我之前发的一个博文:http://blog.csdn.net/lilyth_lilyth/article/details/8973972
梯度下降能帮助我们找到局部最优值,取得很小的损失,但是在数据量达到数十万时,迭代次数高,运算速度慢,十分不适合。这时候可以考虑使用随机梯度下降算法。
所谓随机梯度下降是 每次用 每个样本的损失函数(即样本数为1时的损失函数)对th...
分类:
其他好文 时间:
2014-07-23 13:39:56
阅读次数:
256
H. City HorizonTime Limit: 2000msMemory Limit: 65536KB64-bit integer IO format:%lld Java class name:MainFarmer John has taken his cows on a trip to th...
分类:
其他好文 时间:
2014-07-22 23:21:57
阅读次数:
263
通过学习Lucene3.5.0的doc文档,对不同release版本号 lucene版本号的API修改做分析。最后找到了有价值的修改信息。LUCENE-2302: Deprecated TermAttribute and replaced by a new CharTermAttribute. Th...
分类:
其他好文 时间:
2014-07-22 00:36:33
阅读次数:
258
My first reaction: move all A elements back by n positions, and start everything from A[0] and B[0]. But a smarter idea is to start everything from th...
分类:
其他好文 时间:
2014-07-22 00:35:36
阅读次数:
189
下图是asterisk的呼叫流程图:
我们以sip的呼叫过程为例来描述,其他channel的呼叫过程基本类似。
Astersik下注册的sip用户主动发起一个呼叫的函数调用过程(incoming)如下:
do_monitor->sipsock_read->handle_request->handle_request_invite->sip_new/ast_pbx_start->pbx_th...
分类:
其他好文 时间:
2014-07-22 00:27:37
阅读次数:
294
代码如下:
Tabs
/* Remove margin padding */
body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td { margin:0; padding:0; }
/* Default Font...
分类:
其他好文 时间:
2014-07-22 00:16:33
阅读次数:
316
代码如下:
/*
这以下是重置样式
Remove margin padding */
body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td { margin:0; padding:0; }
/*...
分类:
移动开发 时间:
2014-07-22 00:15:36
阅读次数:
361
题意是给出某个地鼠的出现位置以及出现时间,人有一个移动速度,求此人最多可以打多少个地鼠?我们根据时间把所有的地鼠排序,如果两个地鼠之间的距离不超过时间只差与速度的乘积,那说明打完上一只地鼠还可以打到这一只地鼠。直接f[i]表示打完第i只地鼠且此时在i地鼠位置的期望,DP即可。召唤代码君:/** th...
分类:
其他好文 时间:
2014-07-21 08:04:50
阅读次数:
221
1:修改uc_client\model\user.phpfunction check_username($username) { $guestexp = '\xA1\xA1|\xAC\xA3|^Guest|^\xD3\xCE\xBF\xCD|\xB9\x43\xAB\xC8'; $len = $th...
分类:
其他好文 时间:
2014-07-20 22:01:28
阅读次数:
214
前一篇博文提到怎么得到汉字字库,这篇文章讲怎么把一个一个的字转成图片,这在机器学习中会有用处。
一句话,用pygame渲染文字到图片上。
下面上代码。
import os
import pygame
chinese_dir = 'chinese'
if not os.path.exists(chinese_dir):
os.mkdir(chinese_dir)
pygame.ini...
分类:
编程语言 时间:
2014-07-20 11:43:38
阅读次数:
334