ModelInferenceTime#

class ModelInferenceTime[source]#

Measure model average inference time (in seconds) per sample.

Parameters
n_samplesint , default: 1000

number of samples to use for inference, but if actual dataset is smaller then all samples will be used

__init__(n_samples: int = 1000, **kwargs)[source]#
__new__(*args, **kwargs)#

Methods

ModelInferenceTime.add_condition(name, ...)

Add new condition function to the check.

ModelInferenceTime.add_condition_inference_time_less_than([value])

Add condition - the average model inference time (in seconds) per sample is less than threshold.

ModelInferenceTime.clean_conditions()

Remove all conditions from this check instance.

ModelInferenceTime.conditions_decision(result)

Run conditions on given result.

ModelInferenceTime.config()

Return check configuration (conditions' configuration not yet supported).

ModelInferenceTime.from_config(conf)

Return check object from a CheckConfig object.

ModelInferenceTime.metadata([with_doc_link])

Return check metadata.

ModelInferenceTime.name()

Name of class in split camel case.

ModelInferenceTime.params([show_defaults])

Return parameters to show when printing the check.

ModelInferenceTime.remove_condition(index)

Remove given condition by index.

ModelInferenceTime.run(dataset[, model, ...])

Run check.

ModelInferenceTime.run_logic(context, ...)

Run check.

Examples#