Table Of Contents
Table Of Contents


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

Logs training speed and evaluation metrics periodically.

  • 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.


>>> # Print training speed and evaluation metrics every ten batches. Batch size is one.
>>>, 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.


__init__(batch_size[, frequent, auto_reset])

Initialize self.