Skip to content

Loss & cross-entropy

The training signal: softmax cross-entropy between the model’s next-token logits and the target token ids.

Book (PyTorch) Here (tfjs)
F.cross_entropy tf.losses.softmaxCrossEntropy