首页 AI学术青年与开发者社区

【中文字幕】2017春季CS231n 斯坦福深度视觉识别课

开课时间:2017年11月10日
开课时长:讲座共有6个lecture,3个 Guest Talk,已完结。加入小组即可立即观看(完全免费):https://ai.yanxishe.com/page/groupDetail/19。
免费课 基础入门
现价: 免费
该课程已关闭

Batch Normalization

input data: N training examples in the current batch , and each batch has dimension D

compute the empirical mean and variance independently for each dimension.

BN usually inserted after fully connected or convolutional layers, and before nonlinearity.

[展开全文]

# Double check taht the loss is reasonable: def init_two_layer_model(input_size,hidden_size,output_size): # initialize a model model={} model['W1']=0.0001*np.random.randn(input_size,hidden_size) model['b1']=np.zeros(hidden_size) model['W2']=0.0001*np.random.randn(hidden_size,output_size) model['b2']=np.zeros(output_size) return model model=init_two_layer_model(32*32*3,50,10) #input size,hidden size,number of classes loss,grad=two_layer_net(X_train,model,y_train,0.0) # 0.0 denotes disable regularization print loss """ 如果我们加上了正则项,loss会变大一点,这是完整性 """ """ 往往需要先确保可以过拟合非常小部分的训练数据""" model=init_two_layer_model(32*32*3,50,10) # trainer=ClassfierTrain() X_tiny=x_train[:20] # take examples y_tiny=y_train[:20] best_model,stats=trainer.train(X_tiny,y_tiny,X_tiny,y_tiny, model,two_layer_net, num_epochs=200,reg=0.0, updat='sgd',learning_rate_decay=1, sample_batchs=False, learning_rate=1e-3,verbose=True)

 

1. loss not going down:

learning rate too low

2. 即使损失没怎么变化,但正确率却很快上升到了20%,为什么?

虽然这里的分布依然很分散,因为我们的损失项很接近,但是当我们移动这些分布时,都朝着正确的方向在轻微的移动,我们的权重参数在朝着正确的方向改变,现在准确率可能发生突变,因为我们正选取最大的准确率,所以准确率会得到一个很大的提升,虽然损失还是很分散。

3.loss exploding:

learning rate too high

 

 

[展开全文]
# Double check taht the loss is reasonable
[展开全文]

批量归一化处理(bn):

  为什么我们想恢复这个恒等变换(恒等映射),有什么意义??(为了让他学习参数??)

  因为我们想要数据具有灵活性,将数据转换为高斯数据分布,(貌似高斯分布就具有灵活性)(有点强制转换的意思)

高斯化:(当前值-均值)/方差,先将数据移到原点(平移变换),再进行尺度缩放,得到单位高斯分布。

 

babysitting the learning process(观察学习处理)

 

当你得到cost基本没啥变化的时候,那么说明你的学习率太低了。。(尝试增加学习率)

但是当你cost值一直为nan,说明你的学习率太大了。之歌时候你要尝试减小你的学习率

 

 

超参数的选择:

  采用交叉验证策略

 

[展开全文]

相关课程

开课日期:直播已结束,可回看开始
智能驾驶 基础入门 86959
开课日期:开始
机器学习 基础入门 111692

授课教师

暂无教师
微信扫码分享课程