devices.xylo.mapper

devices.xylo.mapper(graph: rockpool.graph.graph_base.GraphModuleBase, weight_dtype: Union[numpy.dtype, str] = 'float', threshold_dtype: Union[numpy.dtype, str] = 'float', dash_dtype: Union[numpy.dtype, str] = 'float', max_hidden_neurons: int = 1000, max_output_neurons: int = 8) dict[source]

Map a computational graph onto the Xylo v1 architecture

This function performs a DRC of the computational graph to ensure it can be mapped onto the Xylo v1 architecture.

Warning

mapper() operates in-place on the graph, and may modify it. If you need the un-mapped graph, you may need to call Module.as_graph() again on your Module.

It then allocates neurons and converts the network weights into a specification for Xylo. This specification can be used to create a config object with config_from_specification().

Parameters
  • graph (GraphModuleBase) – The graph to map

  • weight_dtype (Union[np.dtype, str]) – Data type for mapped weight parameters. Default: "float"

  • threshold_dtype (Union[np.dtype, str]) – Data type for mapped threshold parameters. Default: "float"

  • dash_dtype (Union[np.dtype, str]) – Data type for mapped dash (bitshift time constant) parameters. Default: "float"

  • max_hidden_neurons (int) – Maximum number of available hidden neurons. Default: 1000, matching Xylo hardware

  • max_output_neurons (int) – Maximum number of available output neurons. Default: 8, matching Xylo hardware

Returns

A dictionary of specifications for Xylo v1, containing the mapped computational graph

Return type

dict