stared / livelossplot

Live training loss plot in Jupyter Notebook for Keras, PyTorch and others
https://p.migdal.pl/livelossplot
MIT License
1.29k stars 143 forks source link

Losing epoch 1 and 2 #69

Closed djp3 closed 5 years ago

djp3 commented 5 years ago

In the example here: https://github.com/stared/livelossplot/blob/master/examples/minimal.ipynb the x axis loses data for epoch 1 and 2 and begins plotting at 3 when there are 3 epochs to plot.

I encountered this in my own notebook and then checked this reference example to demonstrate the same behavior image

djp3 commented 5 years ago

I found the issue. One can pass a parameter to the constructor to change this behavior: liveplot = PlotLosses(skip_first=0)

stared commented 5 years ago

This was a long-required feature (vide #18), as very often first log-losses are very high and irrelevant to the further training process.

I understand it may be confusing (especially as there is no documentation), so indeed - concrete examples may be useful.

djp3 commented 5 years ago

So all I'm proposing is to manually pass the skip_first parameter in the example so that the graph doesn't look broken (especially as it is the "low-level" API example) No change in the main code base necessary given the history that you cite.

stared commented 5 years ago

Yes, it's a fair point that for this minimalistic examples skipping first few entries in confusing. I accepted your PR. Thank you, @djp3 !