Processes

Build Nengo Processes into the TensorFlow graph.

class nengo_dl.process_builders.SimProcessBuilder(ops, signals)[source]

Builds a group of SimProcess operators.

Calls the appropriate sub-build class for the different process types.

Attributes:
TF_PROCESS_IMPL : list of Process

The process 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 Signal to tf.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

build_post(ops, signals, sess, rng)[source]

This function will be called after the graph has been built and session/variables initialized.

This should be used to build any random aspects of the operator.

Note that this function may be called multiple times per session, so it should modify the graph in-place.

Parameters:
ops : list of Operator

The operator group to build into the model

signals : signals.SignalDict

Mapping from Signal to tf.Tensor (updated by operations)

sess : tf.Session

The initialized simulation session

rng : RandomState

Seeded random number generator

class nengo_dl.process_builders.GenericProcessBuilder(ops, signals)[source]

Builds all process 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 processes should consider adding a custom TensorFlow implementation for their 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 Signal to tf.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

build_post(ops, signals, sess, rng)[source]

This function will be called after the graph has been built and session/variables initialized.

This should be used to build any random aspects of the operator.

Note that this function may be called multiple times per session, so it should modify the graph in-place.

Parameters:
ops : list of Operator

The operator group to build into the model

signals : signals.SignalDict

Mapping from Signal to tf.Tensor (updated by operations)

sess : tf.Session

The initialized simulation session

rng : RandomState

Seeded random number generator

class nengo_dl.process_builders.LowpassBuilder(ops, signals)[source]

Build a group of Lowpass synapse operators.

build_step(signals)[source]

This function builds whatever computations need to be executed in each simulation timestep.

Parameters:
signals : signals.SignalDict

Mapping from Signal to tf.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

class nengo_dl.process_builders.LinearFilterBuilder(ops, signals)[source]

Build a group of LinearFilter synapse operators.

build_step(signals)[source]

This function builds whatever computations need to be executed in each simulation timestep.

Parameters:
signals : signals.SignalDict

Mapping from Signal to tf.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