A Streamlit-based interactive app to visualize multiple TensorBoard runs grouped by user-defined tags extracted via regex. Supports aggregation (mean, median), individual run plotting, and interactive Plotly charts.
- Scan directories recursively for TensorBoard event files.
- Extract tags from file paths using regex with named groups.
- Group runs by tags and aggregate metrics.
- Plot metrics with mean/median and standard deviation/percentile bands.
- Optionally overlay individual runs.
- Interactive, fully customizable Plotly charts in Streamlit.
tensorboard_visualizer/
│
└── src/
├── app.py # Main Streamlit app
└── utils/
│── __init__.py
│── file_utils.py # File scanning and path parsing
│── event_utils.py # TensorBoard event parsing and aggregation
- Clone the repository:
git clone https://github.com/Geophyte/tensorboard-visualizer
cd tensorboard_visualizer
- Create a virtual environment (optional but recommended):
python -m venv venv
source venv/bin/activate # Linux/macOS
venv\Scripts\activate # Windows
- Install dependencies:
pip install -r requirenments
Run the Streamlit app:
streamlit run src/app.py
Open the displayed Local URL (usually http://localhost:8501
) in your browser.
-
Data
Base directories
: directories to scan for TensorBoard events.Include regex
/Exclude regex
: filter runs by path.
-
Tag extraction
- Regex patterns to extract tags from file paths (use named groups, e.g.
lr=(?P<lr>\d+\.\d+)
).
- Regex patterns to extract tags from file paths (use named groups, e.g.
-
Plot
- Aggregation method:
mean
ormedian
. - Show individual runs: overlay each run.
- Order groups by:
none
,best_final
,best_max
. - Legend and margins customization.
- Aggregation method:
Suppose your TensorBoard logs are organized like this:
runs/
├── experiment1_lr=0.001_bs=32/
│ └── events.out.tfevents.123
├── experiment1_lr=0.001_bs=64/
│ └── events.out.tfevents.124
├── experiment2_lr=0.01_bs=32/
│ └── events.out.tfevents.125
└── experiment2_lr=0.01_bs=64/
└── events.out.tfevents.126
You want to group runs by learning rate (lr
) and batch size (bs
) and visualize the loss
metric.
Enter the following in the Tag extraction textarea:
lr=(?P<lr>[\d.]+)_bs=(?P<bs>\d+)
This will extract:
Path | lr | bs |
---|---|---|
runs/experiment1_lr=0.001_bs=32/ | 0.001 | 32 |
runs/experiment2_lr=0.01_bs=64/ | 0.01 | 64 |
- In Group runs by these keys, select
lr
andbs
. - Each combination of
lr
andbs
becomes a separate group in the plot.
- Choose
loss
in the Metric to plot dropdown.
- The app will plot the mean (or median) loss across all runs in each group.
- Standard deviation bands will be shaded.
- You can also overlay individual runs if
Show individual runs
is checked.
MIT License