stared / livelossplot

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

fix underscores in metric name #59

Closed sebastienlange closed 5 years ago

sebastienlange commented 5 years ago

While it fixes the underscores in metric name, it does not fix the issue mentionned in #56 because it is a different issue, IMHO not related to custom series, but rather to lr appearing dynamically in logs while not having set in on_train_begin.

Either lr is not a metric, and I would change line 82 in generic_plot.py as such: replace if metric != "_i": by if metric in self.metrics_extrema:

Or lr is a valid metric, and set_metrics should be adapted in on_train_begin or most probably in on_epoch_end. But I'll leave this one to you @stared

Content of logs and base_metrics just before the error in _update_extrema: logs={'val_loss': 0.30390482946038244, 'val_acc': 0.9154, 'val_mean_squared_error': 0.01308123045139946, 'loss': 0.44024413793881734, 'acc': 0.8819166666666667, 'mean_squared_error': 0.019188156543609995, 'lr': 0.001, '_i': 1} base_metrics=['loss', 'acc', 'mean_squared_error'] => so there's no 'lr'

stared commented 5 years ago

@sebastienlange Thanks you! From what I see, the learning rate should be logged. We will see if it fits the convention. I think it is important to add these metrics if needed. Maybe, in the long run, the think with maxima should be another class, with __init__, update (ALSO adding other metrics if necessary) and print methods,

_i should not be plotted by default, as it is an index.