Map 1 · Building and training a network · Step 5

Choose the output and loss

How do I measure how wrong the network is?

Key formula

Fact or figure

Probability 0.95 on the correct class costs ; probability 0.01 costs . Confident mistakes are punished hard.

Skip this step and…

A softmax inside the model plus nn.CrossEntropyLoss applies softmax twice and distorts the gradients.

Digits example

10 logits → nn.CrossEntropyLoss; report accuracy, but train on cross-entropy.

Learn it

Taught in Section 6 (Loss Functions and Output Layers) of the course. The map follows the deep learning workflow, the order you build a model in; the course teaches in the order that is easiest to learn, so the numbers can jump.

How it connects

← Back to the whole map