mxnet.monitor.Monitor¶
-
class
mxnet.monitor.Monitor(interval, stat_func=None, pattern='.*', sort=False)[source]¶ Monitor outputs, weights, and gradients for debugging.
- Parameters
interval (int) – Number of batches between printing.
stat_func (function) – A function that computes statistics of tensors. Takes an NDArray and returns an NDArray. Defaults to mean absolute value |x|/size(x).
pattern (str) – A regular expression specifying which tensors to monitor. Only tensors with names that match name_pattern will be included. For example, ‘.*weight|.*output’ will print all weights and outputs and ‘.*backward.*’ will print all gradients.
-
__init__(interval, stat_func=None, pattern='.*', sort=False)[source]¶ Initialize self. See help(type(self)) for accurate signature.
Methods
__init__(interval[, stat_func, pattern, sort])Initialize self.
install(exe)install callback to executor.
tic()Start collecting stats for current batch.
toc()End collecting for current batch and return results.
toc_print()End collecting and print results.