PyTorch entry study notes (b) of the neural network structures

Neural network can be constructed using touch.nn. nn relies on autograd to define the model, and its derivation. Nn.Module network comprising a layer (layers), while the forward (input) to return output.

Torch.nn Chinese network:
https://ptorch.com/docs/1/torch-nn

Typically the step of training the neural network as follows:
(1) the definition of the neural network, which network comprises a number of parameters that can be learned (e.g., weight)
(2) iterate over the input data set
(3) using a network of input data is processed
(4) Loss is calculated (output value of the distance how far the correct value)
(5) to the gradient back propagation network parameters
(6) the right to update the network weights, a simple update rule: weight = weight - learning_rate * gradient , namely: new weight = old weights - learning rate * gradient value.

Published 16 original articles · won praise 0 · Views 955

Guess you like

Origin blog.csdn.net/qq_44157281/article/details/96481324