Table Of Contents
Table Of Contents

Speedometer

class mxnet.callback.Speedometer(batch_size, frequent=50, auto_reset=True)[source]

Logs training speed and evaluation metrics periodically.

Parameters:
  • batch_size (int) – Batch size of data.
  • frequent (int) – Specifies how frequently training speed and evaluation metrics must be logged. Default behavior is to log once every 50 batches.
  • auto_reset (bool) – Reset the evaluation metrics after each log.

Example

>>> # Print training speed and evaluation metrics every ten batches. Batch size is one.
>>> module.fit(iterator, num_epoch=n_epoch,
... batch_end_callback=mx.callback.Speedometer(1, 10))
Epoch[0] Batch [10] Speed: 1910.41 samples/sec  Train-accuracy=0.200000
Epoch[0] Batch [20] Speed: 1764.83 samples/sec  Train-accuracy=0.400000
Epoch[0] Batch [30] Speed: 1740.59 samples/sec  Train-accuracy=0.500000
__init__(batch_size, frequent=50, auto_reset=True)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(batch_size[, frequent, auto_reset]) Initialize self.