discopat.nn_training.torch_detection_utils.utils

Functions

all_gather(data)

Run all_gather on arbitrary picklable data (not necessarily tensors).

collate_fn(batch)

get_rank()

get_world_size()

is_dist_avail_and_initialized()

is_main_process()

mkdir(path)

reduce_dict(input_dict[, average])

Reduce the values in the dictionary from all processes so that all processes.

setup_for_distributed(is_master)

Disable printing when not in master process.

Classes

MetricLogger([delimiter])

SmoothedValue([window_size, fmt])

Track a series of values and provide access to smoothed values over a window or the global series average.

class discopat.nn_training.torch_detection_utils.utils.MetricLogger(delimiter='\t')[source]

Bases: object

add_meter(name, meter)[source]
log_every(iterable, print_freq, header=None)[source]
synchronize_between_processes()[source]
update(**kwargs)[source]
class discopat.nn_training.torch_detection_utils.utils.SmoothedValue(window_size=20, fmt=None)[source]

Bases: object

Track a series of values and provide access to smoothed values over a window or the global series average.

property avg
property global_avg
property max
property median
synchronize_between_processes()[source]

Warning: does not synchronize the deque!.

update(value, n=1)[source]
property value
discopat.nn_training.torch_detection_utils.utils.all_gather(data)[source]

Run all_gather on arbitrary picklable data (not necessarily tensors).

Parameters:

data – any picklable object

Returns:

list of data gathered from each rank

Return type:

list[data]

discopat.nn_training.torch_detection_utils.utils.collate_fn(batch)[source]
discopat.nn_training.torch_detection_utils.utils.get_rank()[source]
discopat.nn_training.torch_detection_utils.utils.get_world_size()[source]
discopat.nn_training.torch_detection_utils.utils.is_dist_avail_and_initialized()[source]
discopat.nn_training.torch_detection_utils.utils.is_main_process()[source]
discopat.nn_training.torch_detection_utils.utils.mkdir(path)[source]
discopat.nn_training.torch_detection_utils.utils.reduce_dict(input_dict, average=True)[source]

Reduce the values in the dictionary from all processes so that all processes.

Parameters:
  • input_dict (dict) – all the values will be reduced

  • average (bool) – whether to do average or sum have the averaged results.

Returns a dict with the same fields as input_dict, after reduction.

discopat.nn_training.torch_detection_utils.utils.setup_for_distributed(is_master)[source]

Disable printing when not in master process.