Skip to main content

A minimal library for plotting training progress in Jupyter/COLAB notebooks.

Installation

pip install tinygraphs

Options

train_losses: (Required) List of training loss values to plot

val_losses: (Required) List of validation loss values to plot

epoch: (Required) Current epoch number for updating the plot

legend_loc: Location of the legend on the plot (default: "upper right")

updating_title: Boolean flag to indicate if the title should update with epoch progress (default: True)

legend: Boolean flag to show/hide the legend (default: True)

x_label: Label for the x-axis

y_label: Label for the y-axis

title: Main title of the plot

dark_mode: Boolean flag to switch between light and dark themes (default: True)

Usage

import tinygraphs as tg

train_losses, val_losses = [], []
epochs = 3

for epoch in range(epochs):
    # Training
    model.train()
    running_train_loss = 0
    for x, y in train_loader:
        x, y = x.to(device), y.to(device)
        optimizer.zero_grad()
        loss = criterion(model(x), y)
        loss.backward()
        optimizer.step()
        running_train_loss += loss.item()
    train_losses.append(running_train_loss / len(train_loader))

    # Validation
    model.eval()
    running_val_loss = 0
    with torch.no_grad():
        for x, y in val_loader:
            x, y = x.to(device), y.to(device)
            loss = criterion(model(x), y)
            running_val_loss += loss.item()
    val_losses.append(running_val_loss / len(val_loader))

    # Plot using tinygraphs
    tg.plot(train_losses, val_losses, epoch, legend_loc = "upper right", updating_title = False, legend = True, x_label = "x title", y_label = "y title", title = "title", dark_mode = False)

Other Usage Options

    tg.plot(train_losses, val_losses, epoch, legend_loc = "upper right", updating_title = False, legend = True, x_label = "Epoch", y_label = "Loss", title = "Loss Graph", dark_mode = True)

Dark Mode is Awesome!

    tg.plot(train_losses, val_losses, epoch, theme = 'jet')

Beautiful Loss Graph With Barely Any Code!

Metadata

Release files for tinygraphs 2.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tinygraphs 2.0.3
File Size Uploaded Provenance
tinygraphs-2.0.3.tar.gz 4.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for tinygraphs 2.0.3
File Interpreter ABI Platform
tinygraphs-2.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 8.5 kB

Release files / tinygraphs-2.0.3.tar.gz

Download URL tinygraphs-2.0.3.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
137257c06f262e608a53f5b90e6aa88e30bb13ebba37cb1858c8de8999ed6bc6
BLAKE2b-256 checksum
How to use checksums
881729faff6a2f49468850415ea4313df75958355b2bb5fd1b2d697b07ec5223
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / tinygraphs-2.0.3-py3-none-any.whl

Download URL tinygraphs-2.0.3-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
89ea32fb46f335d90924f3429f585f50a34f2da624d86fb4bdb8241ce8be5d50
BLAKE2b-256 checksum
How to use checksums
d3d61d836b0b3066e616a6e43784196a84b5e17ec0975f99963cb5099bc0402c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Security for tinygraphs 2.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page