devices.xylo.config_from_specification

devices.xylo.config_from_specification(weights_in: numpy.ndarray, weights_out: numpy.ndarray, weights_rec: typing.Optional[numpy.ndarray] = None, dash_mem: typing.Optional[numpy.ndarray] = None, dash_mem_out: typing.Optional[numpy.ndarray] = None, dash_syn: typing.Optional[numpy.ndarray] = None, dash_syn_2: typing.Optional[numpy.ndarray] = None, dash_syn_out: typing.Optional[numpy.ndarray] = None, threshold: typing.Optional[numpy.ndarray] = None, threshold_out: typing.Optional[numpy.ndarray] = None, weight_shift_in: int = 0, weight_shift_rec: int = 0, weight_shift_out: int = 0, aliases: typing.Optional[typing.List[typing.List[int]]] = None, *args, **kwargs) -> (<class 'samna.xylo.configuration.XyloConfiguration'>, <class 'bool'>, <class 'str'>)[source]

Convert a full network specification to a xylo config and validate it

See also

For detailed information about the networks supported on Xylo, see Overview of the Xylo development kit

Parameters
  • weights_in (np.ndarray) – A quantised 8-bit input weight matrix (Nin, Nin_res, 2). The third dimension specifies connections onto the second input synapse for each neuron. Nin_res indicates the number of hidden-layer neurons that receive input from the input channels.

  • weights_rec (np.ndarray) – A quantised 8-bit recurrent weight matrix (Nhidden, Nhidden, 2). The third dimension specified connections onto the second input synapse for each neuron. Default: 0

  • weights_out (np.ndarray) – A quantised 8-bit output weight matrix (Nhidden, Nout).

  • dash_mem (np.ndarray) – A vector or list (Nhidden,) specifing decay bitshift for neuron state for each hidden layer neuron. Default: 1

  • dash_mem_out (np.ndarray) – A vector or list (Nout,) specifing decay bitshift for neuron state for each output neuron. Default: 1

  • dash_syn (np.ndarray) – A vector or list (Nhidden,) specifing decay bitshift for synapse 1 state for each hidden layer neuron. Default: 1

  • dash_syn_2 (np.ndarray) – A vector or list (Nhidden,) specifing decay bitshift for synapse 2 state for each hidden layer neuron. Default: 1

  • dash_syn_out (np.ndarray) – A vector or list (Nout,) specifing decay bitshift for synapse state for each output layer neuron. Default: 1

  • threshold (np.ndarray) – A vector or list (Nhidden,) specifing the firing threshold for each hidden layer neuron. Default: 0

  • threshold_out (np.ndarray) – A vector or list (Nout,) specifing the firing threshold for each output layer neuron. Default: 0

  • weight_shift_in (int) – The number of bits to left-shift each input weight. Default: 0

  • weight_shift_rec (int) – The number of bits to left-shift each recurrent weight. Default: 0

  • weight_shift_out (int) – The number of bits to left-shift each output layer weight. Default: 0

  • aliases (Optional[List[List[int]]]) – For each neuron in the hidden population, a list containing the alias targets for that neuron

Returns: (samna.xylo.XyloConfiguration, bool, str): config, is_valid, message

config will be a XyloConfiguration. is_valid will be a boolean flag True iff the configuration is valid. message will be an empty string if the configuration is valid, or a message indicating why the configuration is invalid.