Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bokeh chart fixes and improvements #106

Merged
merged 9 commits into from
May 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.5.1] - 2020-05-28

### Added

- Bokeh colors, scaling, and hover tooltip (see [this PR for screenshots](https://github.com/stared/livelossplot/pull/106)).
- Tests for Neptune, better tests in general.
- Nice Issue templates.

### Fixed

- Bokeh example.
- Made it working in general.

## [0.5.0] - 2020-03-20

It is a major rewrite, with breaking API changes.
Expand All @@ -19,8 +32,8 @@ It requires Python 3.5+, and ideally 3.6+.
- Continuous integration (using GitHub Actions).
- Type hints, mostly for better development and more explicit documentation.
- Way to write new output plugins (see `outputs` directory).
- Examples are readily runnable on Colab.
- A more general way generate groups for plots based on Regex patterns.
- Examples are readily runnable on Colab.
- A more general way generate groups for plots based on Regex patterns.
- Bokeh plot - an initial version.

### Refactored
Expand All @@ -29,18 +42,16 @@ It requires Python 3.5+, and ideally 3.6+.
- `PlotLosses` is no longer a god object.
- Organized input plugins in the `inputs` directory.


### Fixed

- Updated `neptune` and `tensorboard` plugins to support current APIs of the respective libraries.

### Removed

- Python 2.7 support.
- Python 2.7 support.
- Python 3.4 support - due to type hints.
- Python 3.5 support priority. Right it installs an older version of `matplotlib`, 3.0 (the last working with Python 3.5). The current version of `matplotlib` is 3.2, see https://matplotlib.org/3.2.0/users/installing.html. Support for Python 3.5 for `livelossplot` may be dropped at any moment.


## [0.4.2] - 2020-03-06

### Added
Expand All @@ -53,15 +64,13 @@ It requires Python 3.5+, and ideally 3.6+.
- Tensorboard path for Windows.
- Changed PyToune to Poutyne to reflect the API name change of the respective library.


## [0.4.1] - 2019-05-26

### Added

- Custom `matplotlib` subplots.
- 2d plot prediction.


## [0.4.0] - 2019-05-06

For now, it is prehistory.
For now, it is prehistory.
47 changes: 25 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,11 @@

Don't train deep learning models blindfolded! Be impatient and look at each epoch of your training!

**🎉 New release 0.5.0 (20 Mar 2020). See [CHANGELOG](CHANGELOG.md) and updated [EXAMPLES IN COLAB](https://colab.research.google.com/github/stared/livelossplot). There are some API changes, to make it better, cleaner, and more modular. 🎉**
**🎉 New release 0.5.0 (20 Mar 2020). See [CHANGELOG](CHANGELOG.md) and updated [EXAMPLES IN COLAB](https://colab.research.google.com/github/stared/livelossplot). There are some API changes, to make it better, cleaner, and more modular.From 0.5.1 (28 May 2020) there is [Bokeh](https://docs.bokeh.org/en/latest/#) support. 🎉**

A live training loss plot in [Jupyter Notebook](http://jupyter.org/) for [Keras](https://keras.io/), [PyTorch](http://pytorch.org/) and other frameworks. An open-source Python package by [Piotr Migdał](https://p.migdal.pl/), [Bartłomiej Olechno](https://github.com/Bartolo1024/) and [others](https://github.com/stared/livelossplot/graphs/contributors). **Open for collaboration!** (Some tasks are as simple as writing code docstrings, so - no excuses! :))

This project supported by [Jacek Migdał](http://jacek.migdal.pl/), [Marek Cichy](https://medium.com/@marekkcichy/). [Join the sponsors - show your ❤️ and support, and appear on the list](https://github.com/sponsors/stared)! It will give me time and energy to work on this project.


```
```python
from livelossplot import PlotLossesKeras

model.fit(X_train, Y_train,
Expand All @@ -29,36 +26,35 @@ model.fit(X_train, Y_train,

![](livelossplot.gif)

So remember, [log your loss](https://twitter.com/pmigdal/status/943764924983017473)!

* (The most FA)Q: Why not TensorBoard?
* A: Jupyter Notebook compatibility (for exploration and teaching). The simplicity of use.
- (The most FA)Q: Why not TensorBoard?
- A: Jupyter Notebook compatibility (for exploration and teaching). The simplicity of use.

## Installation

To install [this version from PyPI](https://pypi.org/project/livelossplot/), type:

```
```bash
pip install livelossplot
```

To get the newest one from this repo (note that we are in the alpha stage, so there may be frequent updates), type:

```
```bash
pip install git+git://github.com/stared/livelossplot.git
```

## Examples

Look at notebook files with full working [examples](https://github.com/stared/livelossplot/blob/master/examples/):

* [keras.ipynb](https://github.com/stared/livelossplot/blob/master/examples/keras.ipynb) - a Keras callback
* [minimal.ipynb](https://github.com/stared/livelossplot/blob/master/examples/minimal.ipynb) - a bare API, to use anywhere
* [pytorch.ipynb](https://github.com/stared/livelossplot/blob/master/examples/pytorch.ipynb) - a bare API, as applied to PyTorch
* [2d_prediction_maps.ipynb](https://github.com/stared/livelossplot/blob/master/examples/2d_prediction_maps.ipynb) - example of custom plots - 2d prediction maps (0.4.1+)
* [poutyne.ipynb](https://github.com/stared/livelossplot/blob/master/examples/poutyne.ipynb) - a Poutyne callback ([Poutyne](https://poutyne.org/) is a Keras-like framework for PyTorch)
* [torchbearer.ipynb](https://github.com/stared/livelossplot/blob/master/examples/torchbearer.ipynb) - an example using the built in functionality from torchbearer ([torchbearer](https://github.com/ecs-vlc/torchbearer) is a model fitting library for PyTorch)
* [neptune.py](https://github.com/stared/livelossplot/blob/master/examples/neptune.py) and [neptune.ipynb](https://github.com/stared/livelossplot/blob/master/examples/neptune.ipynb) - a [Neptune.AI](https://neptune.au/)
- [keras.ipynb](https://github.com/stared/livelossplot/blob/master/examples/keras.ipynb) - a Keras callback
- [minimal.ipynb](https://github.com/stared/livelossplot/blob/master/examples/minimal.ipynb) - a bare API, to use anywhere
- [bokeh.ipynb](https://github.com/stared/livelossplot/blob/master/examples/minimal.ipynb) - a bare API, plots with Bokeh
- [pytorch.ipynb](https://github.com/stared/livelossplot/blob/master/examples/pytorch.ipynb) - a bare API, as applied to PyTorch
- [2d_prediction_maps.ipynb](https://github.com/stared/livelossplot/blob/master/examples/2d_prediction_maps.ipynb) - example of custom plots - 2d prediction maps (0.4.1+)
- [poutyne.ipynb](https://github.com/stared/livelossplot/blob/master/examples/poutyne.ipynb) - a Poutyne callback ([Poutyne](https://poutyne.org/) is a Keras-like framework for PyTorch)
- [torchbearer.ipynb](https://github.com/stared/livelossplot/blob/master/examples/torchbearer.ipynb) - an example using the built in functionality from torchbearer ([torchbearer](https://github.com/ecs-vlc/torchbearer) is a model fitting library for PyTorch)
- [neptune.py](https://github.com/stared/livelossplot/blob/master/examples/neptune.py) and [neptune.ipynb](https://github.com/stared/livelossplot/blob/master/examples/neptune.ipynb) - a [Neptune.AI](https://neptune.au/)

You [run examples in Colab](https://colab.research.google.com/github/stared/livelossplot).

Expand All @@ -67,10 +63,9 @@ You [run examples in Colab](https://colab.research.google.com/github/stared/live
Text logs are easy, but it's easy to miss the most crucial information: is it learning, doing nothing or overfitting?
Visual feedback allows us to keep track of the training process. Now there is one for Jupyter.

If you want to get serious - use [TensorBoard](https://www.tensorflow.org/programmers_guide/summaries_and_tensorboard), .
If you want to get serious - use [TensorBoard](https://www.tensorflow.org/programmers_guide/summaries_and_tensorboard), .
But what if you just want to train a small model in Jupyter Notebook? Here is a way to do so, using `livelossplot` as a plug&play component


### from livelossplot import ...

`PlotLosses` for a generic API.
Expand All @@ -86,10 +81,9 @@ There are callbacks for common libraries and frameworks: `PlotLossesKeras`, `Plo
Feel invited to write, and contribute, your adapter.
If you want to use a bare logger, there is `MainLogger`.


### from livelossplot.outputs import ...

Plots: `MatplotlibPlot`, `BokehPlot`.
Plots: `MatplotlibPlot`, `BokehPlot`.

Loggers: `ExtremaPrinter` (to standard output), `TensorboardLogger`, `TensorboardTFLogger`, `NeptuneLogger`.

Expand All @@ -101,6 +95,15 @@ plotlosses = PlotLosses(outputs=[MatplotlibPlot(), TensorboardLogger()])

There are custom `matplotlib` plots in `livelossplot.outputs.matplotlib_subplots` you can pass in `MatplotlibPlot` arguments.

If you like to plot with [Bokeh](https://docs.bokeh.org/en/latest/) instead of [matplotlib](https://matplotlib.org/), use

```{python}
plotlosses = PlotLosses(outputs=[BokehPlot()])
```

## Sponsors

This project supported by [Jacek Migdał](http://jacek.migdal.pl/), [Marek Cichy](https://medium.com/@marekkcichy/). [Join the sponsors - show your ❤️ and support, and appear on the list](https://github.com/sponsors/stared)! It will give me time and energy to work on this project.

## Trivia

Expand Down
Loading