sage.utils.record_times

Filename = Foobar.py Description = Lorem ipsum dolor sit amet

Created on Fri May 20 11:53:22 2022

__author__ = nnarenraju __copyright__ = Copyright 2022, ProjectName __credits__ = nnarenraju __license__ = MIT Licence __version__ = 0.0.1 __maintainer__ = nnarenraju __email__ = nnarenraju@gmail.com __status__ = [‘inProgress’, ‘Archived’, ‘inUsage’, ‘Debugging’]

Github Repository: NULL

Documentation: NULL

Functions

plot_split_times(ax, jobs, values, names, tot[, errors])

Draw a horizontal stacked bar chart of timing splits on ax.

record(plot_times, all_total_time, cfg)

Produce and save a five-panel timing breakdown chart for one training epoch.

Module Contents

plot_split_times(ax, jobs, values, names, tot, errors=None)[source]

Draw a horizontal stacked bar chart of timing splits on ax.

Parameters:
  • ax (matplotlib.axes.Axes) – Axes to draw on.

  • jobs (list[str]) – Y-axis job names.

  • values (list[float]) – Time for each segment in seconds.

  • names (list[str]) – Labels for each segment (matched to values).

  • tot (float) – Total time used to compute percentage labels.

  • errors (ignored) – Reserved for future error-bar support.

record(plot_times, all_total_time, cfg)[source]

Produce and save a five-panel timing breakdown chart for one training epoch.

Reads timing dictionaries collected during the epoch and produces stacked horizontal bar charts for: total epoch time, per-sample load time, signal augmentation, noise augmentation, and transforms. Saves the figure to cfg.export_dir.

Parameters:
  • plot_times (dict) – Dictionary with keys "load", "train", "section", "signal_aug", "noise_aug", "transforms" each containing lists of timing measurements.

  • all_total_time (float) – Wall-clock duration of the entire epoch in seconds.

  • cfg (object) – Configuration object with batch_size, num_workers, and export_dir attributes.