Skip to main content

Live training loss plot in Jupyter Notebook for Keras, PyTorch and others.

Project description

# Live Loss Plot

![PyPI version](https://img.shields.io/pypi/pyversions/livelossplot.svg)
![PyPI license](https://img.shields.io/pypi/l/livelossplot.svg)
![PyPI status](https://img.shields.io/pypi/status/livelossplot.svg)
[![Downloads](http://pepy.tech/badge/livelossplot)](http://pepy.tech/count/livelossplot)

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

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ł](http://p.migdal.pl/) et al. **Open for collaboration!** (Some tasks are as simple as writing code docstrings, so - no excuses! :))

```
from livelossplot import PlotLossesKeras

model.fit(X_train, Y_train,
epochs=10,
validation_data=(X_test, Y_test),
callbacks=[PlotLossesKeras()],
verbose=0)
```

![](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). Simplicity of use.

## Installation

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

```
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:

```
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
* [pytoune.ipynb](https://github.com/stared/livelossplot/blob/master/examples/pytoune.ipynb) - a PyToune callback ([PyToune](https://pytoune.org/) is a Keras-like framework for PyTorch)

## Overview

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) or even better - [Neptune - Machine Learning Lab](https://neptune.ml/) (as it allows to compare between models, in a Kaggle leaderboard style).

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.

It started as [this gist](https://gist.github.com/stared/dfb4dfaf6d9a8501cd1cc8b8cb806d2e). Since it went popular, I decided to rewrite it as a package.

## To do

* Add docstrings
* Add [Bokeh](https://bokeh.pydata.org/) backend
* History saving
* Add connectors to TensorBoard and Neptune

If you want more functionality - open an [Issue](https://github.com/stared/livelossplot/issues) or even better - prepare a [Pull Request](https://github.com/stared/livelossplot/pulls).


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

livelossplot-0.2.1.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

livelossplot-0.2.1-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file livelossplot-0.2.1.tar.gz.

File metadata

  • Download URL: livelossplot-0.2.1.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.23.1 CPython/3.5.4

File hashes

Hashes for livelossplot-0.2.1.tar.gz
Algorithm Hash digest
SHA256 c95762e1551b3f1d4455e756bce361e670e489e6dc4baf14a643a589785e21f7
MD5 778f3f04db33fbe8c7888ff800f964be
BLAKE2b-256 33406a88e05f2d5b972bdd65b0f338f7a92ef47efeaa4006a5f061ccac1d9278

See more details on using hashes here.

File details

Details for the file livelossplot-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: livelossplot-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.23.1 CPython/3.5.4

File hashes

Hashes for livelossplot-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5b337819683da10cc49747c77913937a212fc6adb1786486e56ab0e751d9eaa5
MD5 6a209c07f71bdf2c8790cb469b0e5a97
BLAKE2b-256 5067a0d872ceadc464cfde89c832caf159de780b9490c13352fa4ee3468177bf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page