The feedforward neural network has three input coordinates, two hidden sigmoid function units and two output softmax function units. Every input is connected to each hidden unit, and each hidden unit to each output unit; each hidden and output unit also has a bias. A layer diagram is
Algebraically, with ,
with responses conditionally independent. The fourteen displayed weight and bias parameters comprise six input weights, two hidden biases, four output weights and two output biases. The one-hot encoding supplies targets , , and the categorical cross-entropy loss is the negative of . There is softmax non-identifiability under a common shift of both output logits, but the predicted probabilities are well defined.
For one-hot labels and predicted probabilities , the categorical cross-entropy loss is
Stochastic gradient descent initializes , randomly orders the observations in each of five epochs, and for each single-observation batch computes a forward pass, the sample loss, and its gradient, then updates
Backpropagation is used after the forward loss evaluation to compute this gradient from the output layer back through the hidden layers.
The fitted classifier is
and training minimizes the empirical categorical cross-entropy loss
The softmax non-identifiability already proves that the coefficient vector is not unique. For any and , replace both rows of by and both output biases by . Every logit then gains the same value , so all softmax probabilities, classifications, and losses remain unchanged. Permuting the two hidden units supplies another non-uniqueness.
Training minimizes the empirical categorical cross-entropy loss
by stochastic gradient descent. The independent validation set monitors generalization, while the small fixed number of epochs limits how long the network can fit training noise; using validation loss for early stopping would make this safeguard explicit. A forward pass computes all layer activations, class probabilities, and the mini-batch loss. There are training mini-batches per epoch and hence training forward passes, in addition to validation evaluation after each epoch.
For standardized , model1 computes
followed by logits and softmax function probabilities
The parameter count is
For one-hot labels , the categorical cross-entropy loss is
This is the negative conditional log-likelihood of independent categorical labels, equivalently Bernoulli labels in the two-class case.