syne_tune.backend.time_keeper module

class syne_tune.backend.time_keeper.TimeKeeper[source]

Bases: object

To be used by tuner, backend, and scheduler to measure time differences and wait for a specified amount of time. By centralizing this functionality here, we can support simulating experiments much faster than real time if the training evaluation function corresponds to a tabulated benchmark.

start_of_time()[source]

Called at the start of the experiment. Can be called multiple times if several experiments are run in sequence.

time()[source]
Return type:

float

Returns:

Time elapsed since the start of the experiment

time_stamp()[source]
Return type:

datetime

Returns:

Timestamp (datetime) corresponding to time()

advance(step)[source]

Advance time by step. For real time, this means we sleep for step seconds.

class syne_tune.backend.time_keeper.RealTimeKeeper[source]

Bases: TimeKeeper

start_of_time()[source]

Called at the start of the experiment. Can be called multiple times if several experiments are run in sequence.

time()[source]
Return type:

float

Returns:

Time elapsed since the start of the experiment

time_stamp()[source]
Return type:

datetime

Returns:

Timestamp (datetime) corresponding to time()

advance(step)[source]

Advance time by step. For real time, this means we sleep for step seconds.