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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39bd155aa0517edce90a37652c48b638e949239f2f5f3c5a38952ffa53db3716
|
|
| MD5 |
509d661b482d795e026cb0263f173acf
|
|
| BLAKE2b-256 |
8ce4b079b5d2879eb6960ce8f36f7c13ce8cf9efed9c9d04bf91b911435995da
|
Provenance
The following attestation bundles were made for tfviz-1.0.0.tar.gz:
Publisher:
publish.yml on DeepPythonist/TFViz
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tfviz-1.0.0.tar.gz -
Subject digest:
39bd155aa0517edce90a37652c48b638e949239f2f5f3c5a38952ffa53db3716 - Sigstore transparency entry: 614121693
- Sigstore integration time:
-
Permalink:
DeepPythonist/TFViz@37cd54d8190cde3c9a2214b287bb413ef6b62057 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/DeepPythonist
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@37cd54d8190cde3c9a2214b287bb413ef6b62057 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4003f91c2a0b89203ff93ee52597efde5137f1264b94ce1f576633c04e8e0c39
|
|
| MD5 |
b2ca7ef4b4c6d76e0fdcf16458f9c5e4
|
|
| BLAKE2b-256 |
2db62169099a9abfa3bf2fb62405669d5ec4349e3289d7fdfc25d1853f69d1fc
|
Provenance
The following attestation bundles were made for tfviz-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on DeepPythonist/TFViz
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tfviz-1.0.0-py3-none-any.whl -
Subject digest:
4003f91c2a0b89203ff93ee52597efde5137f1264b94ce1f576633c04e8e0c39 - Sigstore transparency entry: 614121713
- Sigstore integration time:
-
Permalink:
DeepPythonist/TFViz@37cd54d8190cde3c9a2214b287bb413ef6b62057 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/DeepPythonist
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@37cd54d8190cde3c9a2214b287bb413ef6b62057 -
Trigger Event:
release
-
Statement type: