neurtu.Benchmark¶
-
class
neurtu.
Benchmark
(wall_time=None, cpu_time=False, peak_memory=False, repeat=1, aggregate=('mean', 'max', 'std'), to_dataframe=None, progress_bar=5.0, **kwargs)[source]¶ Benchmark calculations
Parameters: - wall_time ({bool, dict}, default=None) – measure wall time. When a dictionary, it is passed as parameters to the func:measure_wall_time function. Will default to True, unless some other metric is enabled.
- cpu_time ({bool, dict}, default=False) – measure CPU time. When a dictionary, it is passed as parameters to the
measure_cpu_time()
function. - peak_memory ({bool, dict}, default=False) – measure peak memory usage. When a dictionary, it is passed as parameters
to the
measure_peak_memory()
function. - repeat (int, default=1) – number of repeated measurements
- aggregate ({collection, False}, default=('mean', 'max', 'std')) – when repeat > 1, different runs are indexed by the
runid
key. If pandas is installed and aggregate is a collection, aggregate repeated runs with the provided methods. - to_dataframe (bool, default=None) – whether to convert parametric results to a daframe. By default convert to dataframe is pandas is installed.
- progress_bar ({bool, float}, default=5.0) – if a number, and tqdm is installed, display the progress bar when the estimated benchmark time is larger than the given number of seconds. If False, the progress bar will not be displayed.
- **kwargs (dict) – custom evaluation metrics of the form
key=func
, wherekey
is the metric name, and thefunc
is the evaluation metric that accepts aDelayed
object:func(obj)
.
-
__init__
(wall_time=None, cpu_time=False, peak_memory=False, repeat=1, aggregate=('mean', 'max', 'std'), to_dataframe=None, progress_bar=5.0, **kwargs)[source]¶ Initialize self. See help(type(self)) for accurate signature.
Methods
__init__
([wall_time, cpu_time, peak_memory, …])Initialize self.