Loss & cross-entropy
The training signal: softmax cross-entropy between the model’s next-token logits and the target token ids.
PyTorch → JS mapping
Section titled “PyTorch → JS mapping”| Book (PyTorch) | Here (tfjs) |
|---|---|
F.cross_entropy |
tf.losses.softmaxCrossEntropy |