• Stars
    star
    1,294
  • Rank 36,356 (Top 0.8 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 7 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

livelossplot

livelossplot version - PyPI PyPI status MIT license - PyPI Python version - PyPI GitHub Workflow Status Downloads Twitter @pmigdal

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

(RECENT CHANGES, EXAMPLES IN COLAB, API LOOKUP, CODE)

A live training loss plot in Jupyter Notebook for Keras, PyTorch and other frameworks. An open-source Python package by Piotr Migdał, Bartłomiej Olechno and others. 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)

Animated fig for livelossplot tracking log-loss and accuracy

  • (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, 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:

You run examples in Colab.

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, . 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.

plotlosses = PlotLosses()
plotlosses.update({'acc': 0.7, 'val_acc': 0.4, 'loss': 0.9, 'val_loss': 1.1})
plot.send()  # draw, update logs, etc

There are callbacks for common libraries and frameworks: PlotLossesKeras, PlotLossesKerasTF, PlotLossesPoutyne, PlotLossesIgnite.

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.

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

To use them, initialize PlotLosses with some outputs:

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 instead of matplotlib, use

plotlosses = PlotLosses(outputs=[BokehPlot()])

Sponsors

This project supported by Jacek Migdał, Marek Cichy, Casper da Costa-Luis, and Piotr Zientara. Join the sponsors - show your ❤️ and support, and appear on the list! It will give me time and energy to work on this project.

This project is also supported by a European program Program Operacyjny Inteligentny Rozwój for GearShift - building the engine of behavior of wheeled motor vehicles and map’s generation based on artificial intelligence algorithms implemented on the Unreal Engine platform lead by ECC Games (NCBR grant GameINN).

Trivia

It started as this gist. Since it went popular, I decided to rewrite it as a package.

Oh, and I am in general interested in data vis, see Simple diagrams of convoluted neural networks (and overview of deep learning architecture diagrams):

A good diagram is worth a thousand equations — let’s create more of these!

...or my other data vis projects.

Todo

If you want more functionality - open an Issue or even better - prepare a Pull Request.

More Repositories

1

science-based-games-list

Science-based games - a collaborative list
1,577
star
2

interactive-machine-learning-list

A collaborative list of interactive Machine Learning, Deep Learning and Statistics websites
JavaScript
432
star
3

quantum-game

Quantum Game (old version) - a puzzle game with real quantum mechanics in a browser
JavaScript
343
star
4

thinking-in-tensors-writing-in-pytorch

Thinking in tensors, writing in PyTorch (a hands-on deep learning intro)
Jupyter Notebook
329
star
5

keras-sequential-ascii

ASCII summary for simple sequential models in Keras
Jupyter Notebook
126
star
6

tagoverflow

An interactive map of Stack Exchange tags for all sites.
JavaScript
125
star
7

tag-graph-map-of-stackexchange

Generates map in form of a graph from tags on StackExchange sites, e.g. StackOverflow.
Python
53
star
8

weltschmerz

Weltschmerz by age - "I am X years old and... [Google autocomplete]"
JavaScript
23
star
9

keras-mini-examples

Small Keras examples to get you started
Jupyter Notebook
20
star
10

data-science-pl

Data Science PL knowledge base / baza wiedzy
14
star
11

qubism

Self-similar visualization of many-body wavefunctions (and also: time series, DNA, proteins).
Mathematica
13
star
12

which-ml-are-you

Which ML are you?
Vue
12
star
13

jekyll-blog-pre-2022

Old Piotr Migdał's blog, in Jekyll, pre 2022
HTML
9
star
14

delab-matury

Analiza i wizualizacja danych maturalnych z lat 2010-2014
Jupyter Notebook
8
star
15

wizualizacja-wolnych-lektur

Themes and colours of readings from wolnelektury.pl - a visualization in D3.js.
Python
8
star
16

kfnrd_viz

Wizualizacje danych Krajowego Funduszu na rzecz Dzieci
JavaScript
7
star
17

cv-resume

My Curriculum Vitae / Resume
TeX
7
star
18

uw-ml-python-2017

Jupyter Notebook
6
star
19

hackart-you-in-artwork

Skarby muzeum (1 miejsce w HackArt Muzeum Narodowego w Warszawie)
Jupyter Notebook
6
star
20

pytorch-intro

Intro to PyTorch stuff; now internal, for interns
Jupyter Notebook
5
star
21

gossipingcommons

Gossiping Commons - “don't tell alike” and “no author, please” open licenses
5
star
22

stable-diffusion-keras-m1-gpu

Stable diffusion image generation with KerasCV for Macbook M1 GPU
Jupyter Notebook
4
star
23

se-api-py

A lightweight Python wrapper for StackExchange API v2.1
Python
4
star
24

matrix-decomposition-viz

Work in progress
JavaScript
4
star
25

talk_20160119_jupyter_notebook

Presentation on Jupyter Notebook (IPython Notebook + R) - at Data Science Warsaw Meetup
Jupyter Notebook
3
star
26

old-blog-gridsome-pre-2024

Old Piotr Migdał blog - Gridsome, 2022-2024
Vue
3
star
27

A-numerical-model-of-the-Mafia-game

Party game Mafia (a.k.a. Werewolf) investigated numerically.
Python
3
star
28

menger-vr

Menger Sponge - 3D Fractal VR - A-Frame
HTML
3
star
29

piotr_migdal_resume

Piotr Migdal Resume 2022+, LaTeX AltaCV template
TeX
2
star
30

dl-diag-d3js

Deep Learning architecture diagrams - a D3.js library
JavaScript
2
star
31

random_data_explorations

Random data explorations
Jupyter Notebook
2
star
32

art-tensor-diagrams

Tensor Diagrams expository article in RDMarkdown Distill
TeX
2
star
33

python-neuroaspects-2016

First steps with data analysis in Python - Aspects of Neuroscience 2016
Jupyter Notebook
2
star
34

trypo-brainhack

Jupyter Notebook
1
star
35

diffraction-gratings

Diffraction Gratings, Moire Pattern and Spiral Zone Plates - in PostScript
1
star
36

pypi-search-meteor

PyPI interactive package search in Meteor
JavaScript
1
star
37

stared.github.io

Personal website and blog by Piotr Migdał, in Nuxt 3 Content
Vue
1
star
38

szkolomat_dane

Szkołomat - dane
1
star
39

yarn-adding-pure-typescript-package-example

TypeScript
1
star
40

trolleython

Trolley with Friends - a cynical game (in dev)
JavaScript
1
star
41

nalogi-viz

Wizualizacja nałogów - co dają, co zwalczają (przyciągające się słowa)
Jupyter Notebook
1
star