Skip to main content

Module neural_network

Module neural_network 

Source
Expand description

Multilayer perceptrons trained by backpropagation.

A fully connected feed-forward network x → f(W₁x + b₁) → … → W_L h + b_L, with a linear output and squared-error loss for regression or a softmax output and cross-entropy loss for classification. Gradients come from backpropagation; weights are updated by mini-batch Adam (Kingma and Ba) with L2 weight decay. Inputs (and regression targets) are standardised internally, and weights start from He (ReLU) or Glorot (tanh, sigmoid) initialisation.

See the book entry Multilayer perceptrons and backpropagation.

Structs§

MlpClassifier
A multilayer perceptron for classification (softmax output, cross-entropy loss).
MlpParameters
Network shape and training settings.
MlpRegressor
A multilayer perceptron for regression (linear output, squared-error loss).

Enums§

Activation
The hidden-layer nonlinearity.

Functions§

one_hot
The one-hot encoding of labels (exposed for building custom targets).