Reduce multiple TensorBoard runs to new event (or CSV) files
Project description
This project was inspired by
tensorboard-aggregator
(similar project built with TensorFlow rather than PyTorch) and this SO answer.
Compute reduced statistics (mean
, std
, min
, max
, median
or any other numpy
operation) of multiple TensorBoard runs matching a directory glob pattern. This can for instance be used when training multiple identical models to reduce the noise in their loss/accuracy/error curves to establish statistical significance in performance improvements. The aggregation results can be saved to disk either as new TensorBoard event files or in CSV format.
Requires PyTorch and TensorBoard. No TensorFlow installation required.
Installation
pip install tensorboard-reducer
Usage
Example:
tb-reducer -i 'glob_pattern/of_dirs_to_reduce*' -o basename_of_output_dir -r mean,std,min,max
tb-reducer
has the following flags:
-i/--indirs-glob
(required): Glob pattern of the run directories to reduce.-o/--outdir
(required): Name of the directory to save the new reduced run data. If--format
istb-events
, a separate directory will be created for each reduce op (mean
,std
, ...) suffixed by the op's name (outdir-mean
,outdir-std
, ...). If--format
iscsv
, a single file will created andoutdir
must end with a.csv
extension.-r/--reduce-ops
(optional): Comma-separated names of numpy reduction ops (mean
,std
,min
,max
, ...). Default ismean
. Each reduction is written to a separateoutdir
suffixed by its op name, e.g. ifoutdir='my-new-run
, the mean reduction will be written tomy-new-run-mean
.-f/--format
: Output format of reduced TensorBoard runs. One oftb-events
for regular TensorBoard event files orcsv
. Ifcsv
,-o/--outdir
must have.csv
extension and all reduction ops will be written to a single CSV file rather than separate directories for each reduce op. Usepandas.read_csv("path/to/file.csv", header=[0, 1], index_col=0)
to read data back into memory as a multi-index dataframe.-w/--overwrite
(optional): Whether to overwrite existingoutdir
s/CSV files.
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
Hashes for tensorboard-reducer-0.1.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a3f2661dfa9e1529ec3fd5384740b3d4431593eb1b6171f0b3efe6aa93df0a3 |
|
MD5 | b075fc6cf5f8c2580ce9e29f4f7bc518 |
|
BLAKE2b-256 | 5a864c0b34a31051fce66f88881b0cfb875e9b1b685531ca4af580e6d2de6228 |
Hashes for tensorboard_reducer-0.1.5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c60e5d0caabb75d1b885dc09e2159f71d0bd77a704b53cae099850c316e88330 |
|
MD5 | 68d88e86552e742f251acc635eb75c50 |
|
BLAKE2b-256 | 0adaaec09042dd89b2f7e8d17e94bd21d971914983b1de4e791e9b8c0bde8e2d |