Neuron types¶
Build Nengo neuron types into the TensorFlow graph.
-
class
nengo_dl.neuron_builders.SimNeuronsBuilder(ops, signals)[source]¶ Builds a group of
SimNeuronsoperators.Calls the appropriate sub-build class for the different neuron types.
Attributes: - TF_NEURON_IMPL : list of
NeuronType The neuron types that have a custom implementation
-
build_step(signals)[source]¶ This function builds whatever computations need to be executed in each simulation timestep.
Parameters: - signals :
signals.SignalDict Mapping from
Signaltotf.Tensor(updated by operations)
Returns: - list of ``tf.Tensor``, optional
If not None, the returned tensors correspond to outputs with possible side-effects, i.e. computations that need to be executed in the TensorFlow graph even if their output doesn’t appear to be used
- signals :
- TF_NEURON_IMPL : list of
-
class
nengo_dl.neuron_builders.GenericNeuronBuilder(ops, signals)[source]¶ Builds all neuron types for which there is no custom Tensorflow implementation.
Notes
These will be executed as native Python functions, requiring execution to move in and out of TensorFlow. This can significantly slow down the simulation, so any performance-critical neuron models should consider adding a custom TensorFlow implementation for their neuron type instead.
-
build_step(signals)[source]¶ This function builds whatever computations need to be executed in each simulation timestep.
Parameters: - signals :
signals.SignalDict Mapping from
Signaltotf.Tensor(updated by operations)
Returns: - list of ``tf.Tensor``, optional
If not None, the returned tensors correspond to outputs with possible side-effects, i.e. computations that need to be executed in the TensorFlow graph even if their output doesn’t appear to be used
- signals :
-
-
class
nengo_dl.neuron_builders.RectifiedLinearBuilder(ops, signals)[source]¶ Build a group of
RectifiedLinearneuron operators.-
build_step(signals)[source]¶ This function builds whatever computations need to be executed in each simulation timestep.
Parameters: - signals :
signals.SignalDict Mapping from
Signaltotf.Tensor(updated by operations)
Returns: - list of ``tf.Tensor``, optional
If not None, the returned tensors correspond to outputs with possible side-effects, i.e. computations that need to be executed in the TensorFlow graph even if their output doesn’t appear to be used
- signals :
-
-
class
nengo_dl.neuron_builders.SpikingRectifiedLinearBuilder(ops, signals)[source]¶ Build a group of
SpikingRectifiedLinearneuron operators.-
build_step(signals)[source]¶ This function builds whatever computations need to be executed in each simulation timestep.
Parameters: - signals :
signals.SignalDict Mapping from
Signaltotf.Tensor(updated by operations)
Returns: - list of ``tf.Tensor``, optional
If not None, the returned tensors correspond to outputs with possible side-effects, i.e. computations that need to be executed in the TensorFlow graph even if their output doesn’t appear to be used
- signals :
-
-
class
nengo_dl.neuron_builders.SigmoidBuilder(ops, signals)[source]¶ Build a group of
Sigmoidneuron operators.-
build_step(signals)[source]¶ This function builds whatever computations need to be executed in each simulation timestep.
Parameters: - signals :
signals.SignalDict Mapping from
Signaltotf.Tensor(updated by operations)
Returns: - list of ``tf.Tensor``, optional
If not None, the returned tensors correspond to outputs with possible side-effects, i.e. computations that need to be executed in the TensorFlow graph even if their output doesn’t appear to be used
- signals :
-
-
class
nengo_dl.neuron_builders.LIFRateBuilder(ops, signals)[source]¶ Build a group of
LIFRateneuron operators.-
build_step(signals)[source]¶ This function builds whatever computations need to be executed in each simulation timestep.
Parameters: - signals :
signals.SignalDict Mapping from
Signaltotf.Tensor(updated by operations)
Returns: - list of ``tf.Tensor``, optional
If not None, the returned tensors correspond to outputs with possible side-effects, i.e. computations that need to be executed in the TensorFlow graph even if their output doesn’t appear to be used
- signals :
-
-
class
nengo_dl.neuron_builders.LIFBuilder(ops, signals)[source]¶ Build a group of
LIFneuron operators.-
build_step(signals)[source]¶ This function builds whatever computations need to be executed in each simulation timestep.
Parameters: - signals :
signals.SignalDict Mapping from
Signaltotf.Tensor(updated by operations)
Returns: - list of ``tf.Tensor``, optional
If not None, the returned tensors correspond to outputs with possible side-effects, i.e. computations that need to be executed in the TensorFlow graph even if their output doesn’t appear to be used
- signals :
-
-
class
nengo_dl.neuron_builders.SoftLIFRateBuilder(ops, signals)[source]¶ Build a group of
SoftLIFRateneuron operators.-
build_step(signals)[source]¶ This function builds whatever computations need to be executed in each simulation timestep.
Parameters: - signals :
signals.SignalDict Mapping from
Signaltotf.Tensor(updated by operations)
Returns: - list of ``tf.Tensor``, optional
If not None, the returned tensors correspond to outputs with possible side-effects, i.e. computations that need to be executed in the TensorFlow graph even if their output doesn’t appear to be used
- signals :
-
-
nengo_dl.neuron_builders.get_constant(ops, attr, dtype)[source]¶ Creates a tensor representing the constant parameters of a neuron type.
Parameters: - ops : list of
SimNeurons The operators for some merged group of neuron ops
- attr : str
The attribute of the neuron type that describes the constant parameter
- dtype :
tf.Dtype Numeric type of the parameter
Returns: - ``tf.Tensor``
Tensor containing the values of
attrfor the given ops. This will be a scalar if all the neurons have the same parameter value, or a vector giving the parameter value for each individual neuron.
- ops : list of