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

log scale #102

Closed je-santos closed 4 years ago

je-santos commented 4 years ago

Hi,

would it be possible to add an option to make the axis log? I have it hard coded, but this might be a feature that more people would like :)

Thanks!

stared commented 4 years ago

Thanks for this feedback, @je-santos!

We are investigating how to balance features, and which things to add custom plots.

stared commented 4 years ago

Some things needed rewrite, but with 0.5.2 it is possible: https://github.com/stared/livelossplot/blob/master/examples/matplotlib.ipynb

def custom_after_subplot(ax: plt.Axes, group: str, x_label: str):
    """Make logarithmic scale on loss chart"""
    if group == 'log-loss':
        ax.loglog()
    ax.set_xlabel(x_label)

outputs = [MatplotlibPlot(after_subplot=custom_after_subplot)]
...

image

Let me know it works for you!

We wanted to make it flexible (in particular - you can do this only for some metrics, or modify other options),