Research Article
Interpretable Optimization Training Strategy-Based DCNN and Its Application on CT Image Recognition
Algorithm 1
The samples are randomly discrete and then input into the model for training.
| Calculate and obtain the number of input training samples: | m = size(x, 3); | Obtain the sample number after random dispersion: | kk = randperm(m); | Get batch sample size: | numbatches = m/opts.batchsize; | for l = 1: numbatches | Take out the batchsize samples and corresponding labels after disordering | batch_x = x(:,:, kk((l - 1) opts.batchsize + 1: l opts.batchsize)); | batch_y = y(:, kk((l - 1) opts.batchsize + 1: l opts.batchsize)); | Computes the network output under the current network weights and network inputs: | net = cnnff(net, batch_x); | After the above network output is obtained, bp algorithm is used to get the error pair network weight through the corresponding sample label: | net = cnnbp(net, batch_y); | After obtaining the derivative of the error to the weight, the weight is updated by the weight update method: | net = cnnapplygrads(net, opts); | if isempty(net.rL) | net.rL(1) = net.L; | end | net.rL(end + 1) = 0.99 net.rL(end) + 0.01 net.L; | end |
|