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

Setup outputs as str #113

Closed vfdev-5 closed 4 years ago

vfdev-5 commented 4 years ago

🚀 Feature

Just to improve user's experience with this part of code:

outputs=[MatplotlibPlot(), TensorboardLogger()] plotlosses = PlotLosses(outputs=outputs)


- FR
```python
from livelossplot import PlotLosses

outputs=["matplotlib", "tensorboard", ...]
plotlosses = PlotLosses(outputs=outputs)

@stared what do you think ?

stared commented 4 years ago

I considered that, but prefer to avoid extraneous syntax. Especially in a situation when if we want custom outputs, usually we want custom outputs (e.g. special path to TensorboardLogger ).

If the problem is with extra import line, would the following (not yet implemented) work for you:

from livelossplot import PlotLosses

plotlosses = PlotLosses(outputs=[])
plotlosses.add_matplotlib()
plotlosses.add_tensorboard()
vfdev-5 commented 4 years ago

OK, I see. Maybe, either like this:

from livelossplot import PlotLosses

plotlosses = PlotLosses().add_matplotlib().add_tensorboard()
stared commented 4 years ago

I am a big fan of chaining, so I like it.

Now I see that .to_ may be more descriptive than .add_.

stared commented 4 years ago

@vfdev-5 Merged (will be released with livelossplot >0.5.2):

vfdev-5 commented 4 years ago

Looks nice, thanks !

stared commented 4 years ago

OK, we released 0.5.3.