Skip to main content

Real-time visualization for TensorFlow training metrics

Project description

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

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

tfviz-1.0.0.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

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

tfviz-1.0.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file tfviz-1.0.0.tar.gz.

File metadata

  • Download URL: tfviz-1.0.0.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tfviz-1.0.0.tar.gz
Algorithm Hash digest
SHA256 39bd155aa0517edce90a37652c48b638e949239f2f5f3c5a38952ffa53db3716
MD5 509d661b482d795e026cb0263f173acf
BLAKE2b-256 8ce4b079b5d2879eb6960ce8f36f7c13ce8cf9efed9c9d04bf91b911435995da

See more details on using hashes here.

Provenance

The following attestation bundles were made for tfviz-1.0.0.tar.gz:

Publisher: publish.yml on DeepPythonist/TFViz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tfviz-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: tfviz-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tfviz-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4003f91c2a0b89203ff93ee52597efde5137f1264b94ce1f576633c04e8e0c39
MD5 b2ca7ef4b4c6d76e0fdcf16458f9c5e4
BLAKE2b-256 2db62169099a9abfa3bf2fb62405669d5ec4349e3289d7fdfc25d1853f69d1fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for tfviz-1.0.0-py3-none-any.whl:

Publisher: publish.yml on DeepPythonist/TFViz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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