syne_tune.optimizer.schedulers.utils.simple_profiler module

class syne_tune.optimizer.schedulers.utils.simple_profiler.ProfilingBlock(meta, time_stamp, durations)[source]

Bases: object

meta: Dict[str, Any]
time_stamp: float
durations: Dict[str, List[float]]
class syne_tune.optimizer.schedulers.utils.simple_profiler.SimpleProfiler[source]

Bases: object

Useful to profile time of recurring computations, for example get_config calls in searchers.

Measurements are divided into blocks. A block is started by begin_block. Each block stores meta data, a time stamp when begin_block was called (relative to the time stamp for the first block, which is 0), and a dict of lists of durations, whose keys are tags. A tag corresponds to a range of code to be profiled. It may be executed many times within a block, therefore lists of durations.

Tags can have multiple levels of prefixes, corresponding to brackets.

begin_block(meta)[source]
push_prefix(prefix)[source]
pop_prefix()[source]
start(tag)[source]
stop(tag)[source]
clear()[source]
records_as_dict()[source]

Return records as a dict of lists, can be converted into Pandas data-frame by: :rtype: Dict[str, Any]

pandas.DataFrame.fromDict(…)

Each entry corresponds to a column.