MIR.utils.training_utilsΒΆ

Training utilities (logging, metrics, and patch sampling).

Functions

normalize_01(x[, method, percentile])

Normalize a tensor/array to the range [0, 1].

pad_image(img, target_size)

Zero-pad a 3D tensor at the end of each spatial axis up to a target size.

Classes

AverageMeter()

Computes and stores the current value, the weighted running average and the std of all values seen.

Logger(save_dir)

File-like object that writes to stdout and appends to a log file (typically assigned to sys.stdout).

MultiResPatchSampler3D(patch_size)

Crop corresponding random patches from a multi-resolution feature pyramid and the target.

RandomPatchSampler3D(patch_size)

Crop the same random 3D patch from a feature volume and its target.