• Stars
    star
    175
  • Rank 218,059 (Top 5 %)
  • Language
    Jupyter Notebook
  • License
    MIT License
  • Created about 5 years ago
  • Updated almost 3 years ago

Reviews

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

Repository Details

Creates a learning-curve plot for Jupyter/Colab notebooks that is updated in real-time.

lrcurve

Creates a learning-curve plot for Jupyter/Colab notebooks that is updated in real-time.

There is a framework agnostic interface lrcurve.PlotLearningCurve that works well with PyTorch and Tensorflow and a keras wrapper lrcurve.KerasLearningCurve that uses the keras callback interface.

lrcurve works with python 3.6 or newer and is distributed under the MIT license.

Gif of learning-curve

Install

pip install -U lrcurve

API

Examples

Keras example

Open In Colab

from lrcurve import KerasLearningCurve

model.compile(optimizer=keras.optimizers.Adam(),
              loss=keras.losses.SparseCategoricalCrossentropy(from_logits=True),
              metrics=[keras.metrics.SparseCategoricalAccuracy()])

model.fit(train.x, train.y,
          epochs=100,
          verbose=0,
          validation_data=(validation.x, validation.y),
          callbacks=[KerasLearningCurve()])

Gif of learning-curve for keras example

Framework agnostic example

Open In Colab

with PlotLearningCurve() as plot:
    for i in range(100):
        plot.append(i, {
            'loss': math.exp(-(i+1)/10),
            'val_loss': math.exp(-i/10)
        })
        plot.draw()
        time.sleep(0.1)

Gif of learning-curve for simple example

PyTorch example

Open In Colab

from lrcurve import PlotLearningCurve

plot = PlotLearningCurve(
    mappings = {
        'loss': { 'line': 'train', 'facet': 'loss' },
        'val_loss': { 'line': 'validation', 'facet': 'loss' },
        'acc': { 'line': 'train', 'facet': 'acc' },
        'val_acc': { 'line': 'validation', 'facet': 'acc' }
    },
    facet_config = {
        'loss': { 'name': 'Cross-Entropy', 'limit': [0, None], 'scale': 'linear' },
        'acc': { 'name': 'Accuracy', 'limit': [0, 1], 'scale': 'linear' }
    },
    xaxis_config = { 'name': 'Epoch', 'limit': [0, 500] }
)

with plot:
    # optimize model
    for epoch in range(500):
        # compute loss
        z_test = network(x_test)
        loss_test = criterion(z_test, y_test)

        optimizer.zero_grad()
        z_train = network(x_train)
        loss_train = criterion(z_train, y_train)
        loss_train.backward()
        optimizer.step()

        # compute accuacy
        accuacy_test = sklearn.metrics.accuracy_score(torch.argmax(z_test, 1).numpy(), y_test)
        accuacy_train = sklearn.metrics.accuracy_score(torch.argmax(z_train, 1).numpy(), y_train)

        # append and update
        plot.append(epoch, {
            'loss': loss_train,
            'val_loss': loss_test,
            'acc': accuacy_train,
            'val_acc': accuacy_test
        })
        plot.draw()

Gif of learning-curve for pytorch example

Sponsor

Sponsored by NearForm Research.

More Repositories

1

python-textualheatmap

Create interactive textual heat maps for Jupiter notebooks
Jupyter Notebook
195
star
2

trace

Creates super long stack traces
JavaScript
194
star
3

stable-nalu

Code for Neural Arithmetic Units (ICLR) and Measuring Arithmetic Extrapolation Performance (SEDL|NeurIPS)
Python
145
star
4

clarify

Remove nodecore related stack trace noise
JavaScript
143
star
5

htmlparser-benchmark

Simple benchmark for diffrent htmlparsers using real-life data
HTML
93
star
6

dprof

Dynamic/structured profiling & visualization for sync and async operations
JavaScript
73
star
7

xorshift

Random number generator using xorshift128+
JavaScript
69
star
8

ttest

Perform the Student's t hypothesis test
JavaScript
45
star
9

stack-chain

API for combining call site modifiers
JavaScript
41
star
10

distributions

A collection of probability distribution functions
JavaScript
36
star
11

async-hook

Inspect the life of handle objects in node
JavaScript
36
star
12

article

Analyze a stream of HTML and outputs the article title, text, and image
HTML
27
star
13

immortal

Deprecated: Daemon tool made in pure javascript
JavaScript
21
star
14

nlp-roar-interpretability

Measuring if attention is explanation with ROAR
Python
21
star
15

tfjs-special

Implements Beta, Gamma, Zeta, and Bessel functions for TensorFlow.js
TypeScript
21
star
16

mathfn

Some basic but difficult to implement mathmatical functions
JavaScript
20
star
17

course-02456-sparsemax

TensorFlow and Numpy implementation of sparsemax
Jupyter Notebook
16
star
18

summary

Takes an array of numbers and calculates some descriptive statistics
JavaScript
16
star
19

wasm-dom

WIP: Implements a DOM wrapper for WebAssembly
C++
14
star
20

steer

Use steer to control your chrome (the browser)
JavaScript
14
star
21

execspawn

spawn stream for child_process.exec
JavaScript
11
star
22

dgram-emitter

Very simple EventEmitter on top of a UDP server/client
JavaScript
11
star
23

tcpnet

Create zero config horizontal tcp cluster
JavaScript
10
star
24

master-thesis

Semi-Supervised Neural Machine Translation - for small bilingual datasets
Python
9
star
25

teddybear

blocks the event loop in node.js without draining your cpu
C++
8
star
26

flower

Deprecated: flowers is a collection of stream helpers
JavaScript
8
star
27

editdistance

A much faster than the naΓ―ve levenshtein distance algoritme
JavaScript
7
star
28

piccolo

Isomorphic projection framework
JavaScript
7
star
29

course-42137

Optimization using metaheuristics - University Timetabling
Python
7
star
30

talk-async-wrap

Talk: Introduction to Async Wrap
JavaScript
6
star
31

my-setup

Guides for myself and other, on how some of my stuff is configured.
Shell
6
star
32

startpoint

Converts a single buffer or array of objects intro a stream
JavaScript
6
star
33

interpreted

node-tap wrapper for testing input/output functionality
JavaScript
6
star
34

rfc-csv

RFC 4180 CSV stream parser
JavaScript
6
star
35

domstream

HTML manipulation with progressiv output stream
JavaScript
5
star
36

feedfinder

Transform stream there extracts feed links from a HTML page
JavaScript
5
star
37

faithfulness-measurable-models

Implementation of Faithfulness measurable masked language models
Python
5
star
38

riakdb

riak client with stream interfaces using protocol buffers
JavaScript
4
star
39

endpoint

Converts a stream intro a buffer or array of objects
JavaScript
4
star
40

configme

Simplest possible configuration tool. without conflict - with defaulting!
JavaScript
4
star
41

talk-tracing-tool

Talk: Writing an asynchronous traceing tool
JavaScript
4
star
42

modulebox

node.js like module environment in the browser
JavaScript
4
star
43

llm-introspection

Interpretability faithfulness and introspection in conversational LLMs
Python
4
star
44

levenshtein-benchmark

Simple benchmark for levenshtein using real-life data
JavaScript
3
star
45

drugged

Prototypal extendable HTTP router with domain integration
JavaScript
3
star
46

cahier

static file conversion, writing and reading
JavaScript
3
star
47

perceive

Inspect values with peace by readability
JavaScript
3
star
48

gmid

Creates an overcomplicated none standard unique ID.
JavaScript
3
star
49

mockney

Mock TCP connection by redirecting them
JavaScript
3
star
50

steer-screenshot

Take a screenshot of a google chrome window
JavaScript
3
star
51

fusspos

Fussy string search giving some estimate of a substring position
JavaScript
2
star
52

newlinepoint

Normalize or convert newlines
JavaScript
2
star
53

safedir

Find directory files, and return an array
JavaScript
2
star
54

indexof-surrounding

Like indexOf but looks at surrounding items
JavaScript
2
star
55

localizer

Localized and configureable async and sync `requre.resolve()` implementation.
JavaScript
2
star
56

nspoint

Split a dublex object stream intro multiply dublex streams
JavaScript
2
star
57

reversepoint

Reverse an object stream
JavaScript
2
star
58

equilibrium

static file write stream with automatic truncate and query
JavaScript
2
star
59

grace

The world coolest analysis of the grace data, made by two crazy kids
Python
2
star
60

ndjsonpoint

Parse each line in a stream as separate JSON strings
JavaScript
2
star
61

qoutes

A continues stream of qoutes for each day.
JavaScript
2
star
62

mariastream

Simplified stream interface for mariaDB
JavaScript
2
star
63

daily

daily - A LevelDB based logging system
JavaScript
2
star
64

mappoint

When you simply need to map a stream
JavaScript
2
star
65

daily-protocol

daily - The protocol encoder and decoder for network communcation
JavaScript
2
star
66

isme

Check that ip match this computer
JavaScript
2
star
67

talk-textual-interpretability

Talk on textual interpretability
JavaScript
2
star
68

notmodified

set and validate http cache headers
JavaScript
2
star
69

piccolo-website

Website for piccolo - The isomorphic projection framework
JavaScript
1
star
70

steer-loaded

Heuristic for detecting when a page is loaded in google chrome
JavaScript
1
star
71

daily-storage

daily - The LevelDB storage abstaction
JavaScript
1
star
72

blow

Simple browser wrapper on test framework: mocha
JavaScript
1
star
73

binary-view

Return a pretty binary print of a typed array
JavaScript
1
star
74

fsquery

Query async fs module calls
JavaScript
1
star
75

drainage

Simple pausable id based queue system with shortage notification
JavaScript
1
star
76

bachelor-code

The code for my B.Sc.Eng. thesis work
Python
1
star
77

bachelor-report

The latex report containing my B.Sc.Eng. thesis work
TeX
1
star
78

domstream-client

domstream API on the client
JavaScript
1
star
79

wspoint

Create a dublex stream around a websocket
JavaScript
1
star
80

steer-evalute

Evaluate a script in google chrome
JavaScript
1
star
81

daily-interface

daily - The transport independent interface
JavaScript
1
star
82

typepoint

Typecast properties in object streams
JavaScript
1
star
83

slicepoint

Slice a stream
JavaScript
1
star
84

binarypoint

Split a binary duplex stream up at its null bytes
JavaScript
1
star
85

chrome-bug

Oh look, is this a bug in chrome?
JavaScript
1
star
86

worddiff

Counts the number of unordered word diffrences in two strings
JavaScript
1
star
87

tensorflow-sparsemax-benchmark

Benchmark suite for https://github.com/tensorflow/tensorflow/pull/6387
Python
1
star
88

thintalk

Deprecated: A minimal extendable RPC abstraction with buildin TPC and IPC support
JavaScript
1
star
89

cluster-vhost

Deprecated: Virtual host plugin for node cluster
JavaScript
1
star
90

interface-name

Returns the interface name for an IP address
JavaScript
1
star
91

steer-reset

Reset the state in google chrome
JavaScript
1
star
92

inspectpoint

Transforms objects intro pipeable buffers using util.inspect
JavaScript
1
star
93

andreasmadsen.github.io

Personal website
HTML
1
star