Summary

wandb.sdk.wandb_summary

[view_source]

SummaryDict Objects

@six.add_metaclass(abc.ABCMeta)
class SummaryDict(object)

[view_source]

dict-like which wraps all nested dictionraries in a SummarySubDict, and triggers self._root._callback on property changes.

Summary Objects

class Summary(SummaryDict)

[view_source]

Summary

The summary statistics are used to track single metrics per model. Calling wandb.log({'accuracy': 0.9}) will automatically set wandb.summary['accuracy'] to be 0.9 unless the code has changed wandb.summary['accuracy'] manually.

Setting wandb.summary['accuracy'] manually can be useful if you want to keep a record of the accuracy of the best model while using wandb.log() to keep a record of the accuracy at every step.

You may want to store evaluation metrics in a runs summary after training has completed. Summary can handle numpy arrays, pytorch tensors or tensorflow tensors. When a value is one of these types we persist the entire tensor in a binary file and store high level metrics in the summary object such as min, mean, variance, 95% percentile, etc.

Examples:

wandb.init(config=args)
best_accuracy = 0
for epoch in range(1, args.epochs + 1):
test_loss, test_accuracy = test()
if (test_accuracy > best_accuracy):
wandb.run.summary["best_accuracy"] = test_accuracy
best_accuracy = test_accuracy

SummarySubDict Objects

class SummarySubDict(SummaryDict)

[view_source]

Non-root node of the summary data structure. Contains a path to itself from the root.