core.utils.trainutils.RuntimeLimits

core.utils.trainutils.RuntimeLimits(
    max_time_per_run=None,
    max_epochs_per_run=None,
    max_epochs_total=None,
    epoch_start=None,
)

Keeps track of the runtime limits (time limit, epoch limit, max. number of epochs for model).

Parameters

Name Type Description Default
max_time_per_run float maximum time for run, in seconds [soft limit, break only after full epoch] None
max_epochs_per_run int maximum number of epochs for run None
max_epochs_total int maximum total number of epochs for model None
epoch_start int start epoch of run None

Attributes

Name Description
epoch_start
max_epochs_per_run
max_epochs_total
max_time_per_run
time_start

Methods

Name Description
limits_exceeded Check whether any of the runtime limits are exceeded.
local_limits_exceeded Check whether any of the local runtime limits are exceeded. Local runtime

limits_exceeded

core.utils.trainutils.RuntimeLimits.limits_exceeded(epoch=None)

Check whether any of the runtime limits are exceeded.

Parameters

Name Type Description Default
epoch int None

Returns

Name Type Description
limits_exceeded bool flag whether runtime limits are exceeded and run should be stopped; if limits_exceeded = True, this prints a message for the reason

local_limits_exceeded

core.utils.trainutils.RuntimeLimits.local_limits_exceeded(epoch=None)

Check whether any of the local runtime limits are exceeded. Local runtime limits include max_epochs_per_run and max_time_per_run, but not max_epochs_total.

Parameters

Name Type Description Default
epoch int None

Returns

Name Type Description
limits_exceeded bool flag whether local runtime limits are exceeded