Matlab神经网络十讲(4): Setup Parameters and Train CNN

本文介绍了在Matlab中训练神经网络时如何设置参数,包括选择SGDM优化器,设置最大迭代次数和学习率,指定验证数据,选择硬件资源,以及在卷积和全连接层中设定参数和初始化权重。
摘要由CSDN通过智能技术生成

1. Overview 

          After we define the layers of our network, the next step is to set up the training options for the network. Use thetrainingOptions function to set up the global ntraining parameters.trainNetwork then uses these options to perform the training.trainingOptions returns these options as aTrainingOptionsSGDM object and we must provide it as an input argument to trainNetwork. For example,

opts = trainingOptions('sgdm');
convnet = trainNetwork(data,layers,opts);

2. Set up the Parameters

      2.1 Specify Solver and Maximum Number of Epochs

          trainNetwork uses the “Stochastic Gradient Descent with Momentum(带有动量的随机梯度下降算法)” (SGDM) as the optimization algorithm. We must specify 'sgdm' as the SolverName input argument of trainingOptions.SGDM updates the weights and biases (parameters) by taking small steps in the direction of the negative gradient of the loss function, in such a way to minimize the loss. It updates the parameters using a subset of the data every time. This subset is called a mini-batch. We can specify the size of the mini-batch using the 'MiniBatchSize' name-value pair argument of trainingOptions.

         Each evaluation of the gradient using a mini-batch is called aniteration. A full pass through the whole data set is called an

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值