mighty.monitor.batch_timer.BatchTimer

class mighty.monitor.batch_timer.BatchTimer[source]

A global batch timer.

Methods

__init__()

epoch_progress()

Returns:

init(batches_in_epoch)

Initialize the timer by providing the epoch length.

is_epoch_finished()

Returns:

set_epoch(epoch)

Manually set the epoch.

tick()

Increments the number of elapsed batches by 1.

Attributes

epoch

Returns:

property epoch
Returns:
int

Epoch id.

epoch_progress()[source]
Returns:
float

Epoch progress.

init(batches_in_epoch)[source]

Initialize the timer by providing the epoch length.

Parameters:
batches_in_epochint

The number of batches in an epoch.

is_epoch_finished()[source]
Returns:
bool

Whether it’s the end of an epoch (True) or in the middle of training (False).

set_epoch(epoch)[source]

Manually set the epoch.

Parameters:
epochint

A new epoch.

tick()[source]

Increments the number of elapsed batches by 1.