CS231n课程笔记:Leture6 Training Neural Networks I

目录

 pART1

 Activation Functions

 Data Preprocessing

Weight Initialization

Batch Normalization***

 Babysetting the learning process

 

 

 pART1

 Activation Functions

 

   

 

 

 

 

 

 In practice

 Data Preprocessing

 about PCA:

PCA(principal component analysis,主成分分析) - 简书 (jianshu.com)

Weight Initialization

four ways for weights initialization

(21条消息) 权值初始化——高斯初始化,Xavier初始化,MSRA初始化,He初始化_caicaiatnbu的博客-CSDN博客_高斯分布初始化

  

A good general rule of thumb is basically use the Xavier initialization to start with, and then you can also think about some of these other kinds of methods.

Batch Normalization***

 We just estimate this at training time

 Babysetting the learning process

How do we monitor training?and how do we adjust hyperparameters as we go to get a good learning result?

codes for initial network

def init_two_layer_model(input_size, hidden_size, output_size):
    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 is the disable regularization
print loss 

trying to train

trainer = ClassifierTrainer()
X_tiny = X_train[:20] # take 20 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, update='sgd',learning_rate_decay=1, sample_batches=False, learning_rate=1e-3, sample_batches=True, verbose=True)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Lyttonkeepgoing

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值