Skip to main content

utils.stats.basic_stats

Basic Stats module.

StatInitArguments Objects#

@dataclasses.dataclass
class StatInitArguments()

Stats Arguments.

BasicStats Objects#

class BasicStats()

Basis Stats class provides a common place for collects long interval stats and step interval stats that can be recorded in the various writers provided at the time of calling rebuild() in trainer. This class is used as a Singleton pattern via global_stats provided in the init.py file.

rebuild#

def rebuild(args: StatInitArguments, writers: Iterable)

Rebuild Stat Args and Writers.

reset#

def reset()

Reset all stats.

reset_short#

def reset_short()

Reset step interval stats.

reset_long#

def reset_long()

Reset long interval stats.

update#

def update(k, v, frequent=False)

Update step interval and long interval scalar stats.

update_multi#

def update_multi(k, v: dict, frequent=False)

Update step interval and long interval multiple scalar stats.

update_matplotlib_figure#

def update_matplotlib_figure(fig, tag)

Update matplotlib figure.

update_image#

def update_image(k, v, dataformats='HW')

Update image. Will be logged with infrequent metric.

update_pr#

def update_pr(k, preds, labels)

Update pr curve stats. Only binary classification preds = probabilities

update_histogram#

def update_histogram(k, vals, extend=False)

Update histogram stats.

update_embedding#

def update_embedding(k, embs, labels)

Update embeddings. Used to project embeddings with corresponding labels (numerical).

update_system_stats#

def update_system_stats()

Update system stats related to Memory and Compute (CPU and GPUs) usage.

log_long_stats#

def log_long_stats(step)

Log long interval stats to correponding writers.

log_args#

def log_args(args)

Log Arguments to correponding writers.

log_model#

def log_model(step, model, force=False, grad_scale=1)

Log model to correponding writers.

log_graph#

def log_graph(model, device)

Log graph to correponding writers.

finish#

def finish()

Call finish() on all writers.