Skip to main content

TFViz

Real-time visualization for TensorFlow training metrics with automatic color coding and professional plotting capabilities.

Features

  • Real-time plotting with configurable update frequency
  • Automatic metric categorization (loss, accuracy, precision, recall, etc.)
  • Thread-safe operations for async plotting
  • Multiple visualization themes (dark, light, minimal)
  • TensorFlow Callback integration for seamless training monitoring
  • Configurable plot styles (line, scatter, bar, histogram)
  • Export/import capabilities for metric data
  • Professional API with type hints and error handling
  • Distinct color coding for training vs validation metrics

Quick Start

from tfviz import TFVizCallback

callback = TFVizCallback()
model.fit(X_train, y_train, callbacks=[callback])

Installation

pip install tfviz

Basic Usage

Simple Training Visualization

import tensorflow as tf
from tfviz import TFVizCallback

# Load your data
(x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data()

# Create your model
model = tf.keras.Sequential([
    tf.keras.layers.Dense(128, activation='relu'),
    tf.keras.layers.Dense(10, activation='softmax')
])
model.compile(optimizer='adam', loss='sparse_categorical_crossentropy', metrics=['accuracy'])

# Add TFViz callback
callback = TFVizCallback()

# Train with visualization
model.fit(x_train, y_train, epochs=10, validation_data=(x_test, y_test), callbacks=[callback])

Advanced Configuration

from tfviz import TFVizCallback, TFVizConfig
from tfviz.config import Theme, PlotStyle

# Custom configuration
config = TFVizConfig(
    theme=Theme.DARK,
    plot_config=PlotConfig(style=PlotStyle.LINE),
    update_config=UpdateConfig(frequency=5)
)

callback = TFVizCallback(config=config)
model.fit(X_train, y_train, callbacks=[callback])

Library Structure

tfviz/
├── __init__.py          # Main package exports
├── config.py            # Configuration classes and settings
├── metrics.py           # Metrics tracking and management
├── visualizer.py        # Visualization engine and plotting
└── callback.py          # TensorFlow callback integration

Components

TFVizConfig

Configuration management with themes, plot styles, and update settings.

MetricsTracker

Thread-safe metrics collection with automatic categorization and statistics.

VisualizationEngine

Matplotlib-based plotting engine with async capabilities and multiple themes.

TFVizCallback

TensorFlow callback for automatic metric collection and visualization during training.

Color Coding

The library automatically assigns distinct colors to different metrics:

  • Training Loss: Red
  • Validation Loss: Blue
  • Training Accuracy: Green
  • Validation Accuracy: Orange

Requirements

  • Python 3.7+
  • TensorFlow 2.x
  • Matplotlib
  • NumPy

License

MIT License

Metadata

Release files for tfviz 1.0.0

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

Source distribution (sdist)

Source distribution for tfviz 1.0.0
File Size Uploaded
tfviz-1.0.0.tar.gz 11.6 kB Details

Built distribution (wheel)

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

Total release size: 22.7 kB

Release files / tfviz-1.0.0.tar.gz

Download URL tfviz-1.0.0.tar.gz
Size 11.6 kB
Tags Source
SHA-256 checksum
How to use checksums
39bd155aa0517edce90a37652c48b638e949239f2f5f3c5a38952ffa53db3716
BLAKE2b-256 checksum
How to use checksums
8ce4b079b5d2879eb6960ce8f36f7c13ce8cf9efed9c9d04bf91b911435995da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2025.

Transparency log

Release files / tfviz-1.0.0-py3-none-any.whl

Download URL tfviz-1.0.0-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4003f91c2a0b89203ff93ee52597efde5137f1264b94ce1f576633c04e8e0c39
BLAKE2b-256 checksum
How to use checksums
2db62169099a9abfa3bf2fb62405669d5ec4349e3289d7fdfc25d1853f69d1fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

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