Skip to main content

Reduce multiple TensorBoard runs to new event (or CSV) files

Project description

TensorBoard Reducer

Tests pre-commit.ci status PyPI This project supports Python 3.6+ License GitHub Repo Size

This project was inspired by tensorboard-aggregator (a 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 be used after training multiple identical models to reduce the noise in their loss/accuracy/error curves e.g. when trying to establish a statistically significant improvement in training performance.

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

Mean of 3 TensorBoard logs

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 is tb-events, a separate directory will be created for each reduce op (mean, std, ...) post-fixed by the op's name (outdir-mean, outdir-std, ...). If --format is csv, a single file will created and outdir must end with a .csv extension.
  • -r/--reduce-ops (required): Comma-separated names of numpy reduction ops (mean, std, min, max, ...). Default is mean. Each reduction is written to a separate outdir suffixed by its op name, e.g. if outdir='my-new-run, the mean reduction will be written to my-new-run-mean.
  • -f/--format: Output format of reduced TensorBoard runs. One of tb-events for regular TensorBoard event files or csv. If csv, -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. Use pandas.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 existing outdirs/CSV files.

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

tensorboard-reducer-0.1.4.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

tensorboard_reducer-0.1.4-py2.py3-none-any.whl (7.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file tensorboard-reducer-0.1.4.tar.gz.

File metadata

  • Download URL: tensorboard-reducer-0.1.4.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.5

File hashes

Hashes for tensorboard-reducer-0.1.4.tar.gz
Algorithm Hash digest
SHA256 4c27d638b32ec52e1d4d4978e6d6f8a7b9a02f4155a210a1d1df0ef54633f149
MD5 447d91e02d329c2ef1b53439fe04db2f
BLAKE2b-256 4854105ed59ab2ce4288e2937ae422b2c1472163d8843276d61baa2ed510011a

See more details on using hashes here.

File details

Details for the file tensorboard_reducer-0.1.4-py2.py3-none-any.whl.

File metadata

  • Download URL: tensorboard_reducer-0.1.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.5

File hashes

Hashes for tensorboard_reducer-0.1.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ad98bc84dbdcca7d89733ecafde1f81579b6ac28d49d3c0c0cd3c9d74e3f4090
MD5 32a1c0cc36732d34e558c6462f83a779
BLAKE2b-256 e94a6411371f739c97e472dbc8938e52323cc0efb3477afbc9bee61f591d100e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page