aihwkit.experiments.runners.i_local module

Runner that executes Experiments locally.

class aihwkit.experiments.runners.i_local.InferenceLocalRunner(device=None)[source]

Bases: Runner

Runner that executes Experiments locally.

Class that allows executing Experiments locally.

Parameters:

device (device | None) –

run(experiment, max_elements=0, dataset_root='/tmp/datasets', stdout=False)[source]

Run a single Experiment.

Executes an experiment locally, in the device specified by self.device, optionally printing information to stdout.

Note

If using a dataset different than FashionMNIST or SVHN, the runner assumes that the files for the dataset are downloaded at dataset_root. For those two datasets, the downloading will take place automatically if the files are not present.

Parameters:
  • experiment (BasicInferencing) – the experiment to be executed.

  • max_elements (int) – limit on the amount of samples to use from the dataset. If 0, no limit is applied.

  • dataset_root (str) – path for the dataset files.

  • stdout (bool) – enable printing to stdout during the execution of the experiment.

Returns:

A dictionary with the inference results.

Return type:

Dict