torchdistill.misc
torchdistill.misc.log
- torchdistill.misc.log.set_basic_log_config()[source]
Sets a default basic configuration for logging.
- torchdistill.misc.log.setup_log_file(log_file_path)[source]
Sets a file handler with
log_file_path
to write a log file.- Parameters:
log_file_path (str) – log file path.
- class torchdistill.misc.log.SmoothedValue(window_size=20, fmt=None)[source]
A deque-based value object tracks a series of values and provides access to smoothed values over a window or the global series average. The original implementation is https://github.com/pytorch/vision/blob/main/references/classification/utils.py
- Parameters:
window_size (int) – window size.
fmt (str or None) – text format.
- class torchdistill.misc.log.MetricLogger(delimiter='\t')[source]
A metric logger with
SmoothedValue
. The original implementation is https://github.com/pytorch/vision/blob/main/references/classification/utils.py- Parameters:
delimiter (str) – delimiter in a log message.
- update(**kwargs)[source]
Updates a metric dict whose values are
SmoothedValue
.- Parameters:
kwargs (dict) – keys and values.
- add_meter(name, meter)[source]
Add a new metric name and value.
- Parameters:
name (str) – metric name.
meter (SmoothedValue) – smoothed value.