a-PyTorch-Tutorial-to-Object-Detection icon indicating copy to clipboard operation
a-PyTorch-Tutorial-to-Object-Detection copied to clipboard

Loss calculations

Open madiltalay opened this issue 5 years ago • 0 comments

Dear Sir, I am a bit confused about the loss calculations. These two snippets from the train log would help me better explain the confusion.

Epoch: [7][0/250] Batch Time 1.087 (1.087) Data Time 0.641 (0.641) Loss 4.4972 (4.4972) Epoch: [7][200/250] Batch Time 0.347 (0.349) Data Time 0.000 (0.003) Loss 4.4606 (4.2053) [0/313] Batch Time 0.727 (0.727) Loss 4.6890 (4.6890) [200/313] Batch Time 0.137 (0.140) Loss 5.0137 (5.0349)

  • LOSS - 5.032

Epoch: [138][0/250] Batch Time 0.931 (0.931) Data Time 0.560 (0.560) Loss 0.1863 (0.1863) Epoch: [138][200/250] Batch Time 0.344 (0.349) Data Time 0.000 (0.003) Loss 0.1613 (0.1790) [0/313] Batch Time 0.697 (0.697) Loss 10.3283 (10.3283) [200/313] Batch Time 0.137 (0.141) Loss 11.1063 (10.4203)

  • LOSS - 10.459

On epoch 7, the loss shown besides the 'Data Time' is about 4, while the average loss is about 5. On epoch 138, the loss shown besides the 'Data Time' is about 0.2, while the average loss is about 10. Looking at the loss shown besides 'Data Time', I see that my model is learning well, but looking at the average loss, it seems that the model is diverging. Can you please guide? Thanks

madiltalay avatar Jul 11 '19 15:07 madiltalay