jaxsnn.event.hardware.experiment.Experiment

class jaxsnn.event.hardware.experiment.Experiment(wafer_config: jaxsnn.event.hardware.calib.WaferConfig, hw_routing_func=<_pygrenade_vx_network_routing.PortfolioRouter object>, execution_instance: pygrenade_common.ExecutionInstanceID = ExecutionInstanceID(0))

Bases: object

Experiment class for describing experiments on hardware

__init__(wafer_config: jaxsnn.event.hardware.calib.WaferConfig, hw_routing_func=<_pygrenade_vx_network_routing.PortfolioRouter object>, execution_instance: pygrenade_common.ExecutionInstanceID = ExecutionInstanceID(0))None

Instanziate a new experiment, represting an experiment on hardware and/or in software.

Methods

__init__(wafer_config[, hw_routing_func, …])

Instanziate a new experiment, represting an experiment on hardware and/or in software.

clear()

Reset the experiments’s state.

get_hw_results(inputs, weights, runtime, …)

Executes the experiment on hardware using the information added to the experiment for a time given by runtime and returns a dict of hardware data represented as PyTorch data types.

load_calib([calib_path])

Load a calibration from path calib_path and apply to the experiment`s chip object. If no path is specified a nightly calib is applied. :param calib_path: The path to the calibration. It None, the nightly calib is loaded. :return: Returns the chip object for the given calibration.

register_population(module)

Register a module as population.

register_projection(module)

Register a module as projection.

clear()None

Reset the experiments’s state. Corresponds to creating a new Experiment instance.

get_hw_results(inputs: jaxsnn.event.types.Spike, weights: List[Union[jaxsnn.event.types.WeightInput, jaxsnn.event.types.WeightRecurrent]], runtime: int, n_spikes: List[int], time_data: Optional[dict, None] = None, build_graph: bool = True, hw_cycle_correction: Optional[int, None] = None)List[jaxsnn.event.types.Spike]

Executes the experiment on hardware using the information added to the experiment for a time given by runtime and returns a dict of hardware data represented as PyTorch data types.

Parameters

runtime – The runtime of the experiment on hardware in us.

Returns

Returns the data map as dict, where the keys are the population descriptors and values are tuples of values returned by the correpsonding module’s post_process method.

load_calib(calib_path: Optional[Union[pathlib.Path, str]] = None)pylola_vx_v3.Chip

Load a calibration from path calib_path and apply to the experiment`s chip object. If no path is specified a nightly calib is applied. :param calib_path: The path to the calibration. It None, the nightly

calib is loaded.

Returns

Returns the chip object for the given calibration.

register_population(module: Union[jaxsnn.event.hardware.input_neuron.InputNeuron, jaxsnn.event.hardware.neuron.Neuron])None

Register a module as population.

Parameters

module – The module to register as population.

register_projection(module: jaxsnn.event.hardware.synapse.Synapse)None

Register a module as projection.

Parameters

module – The module to register as projection.