A Python library for creating and simulating large-scale brain models
Added
ChannelShape.from_space_and_channels
to easily construct a ChannelShape
from a spatial shape and number of channels. (#1648)ConvolutionTranspose
transform to perform transposed convolution. It is commonly used for various forms of upsampling in deep networks. (#1648)Conv
and ConvTranspose
aliases for Convolution
and ConvolutionTranspose
. (#1648)Changed
Removed
nengo.utils.graphs.graph
(this was a small utility function for building graphs that was only used in tests). (#1654)simulator.ProbeDict
alias; this was previously renamed to simulator.SimulationData
. (#1649)Fixed
Node
output functions would receive a copy of the input signal, while Process
step functions would not. Process
step functions now also receive copies. (#1679)Neurons.probeable
have been removed. (#1681)Added
step_order
attribute to nengo.Simulator
, which contains an ordered list of the operations run on each timestep. (#1615)make_state
method to NeuronType
, which initializes the neuron type's state variables. (#1609)spiking
attribute to NeuronType
, which exposes whether a neuron type is spiking or non-spiking. (#1609)negative
attribute to NeuronType
, which indicates whether the neuron type can have negative outputs. (#1609)Tanh
neuron type to simulate hyperbolic tangent neurons. (#1609)RatesToSpikesNeuronType
, which is a base class for neuron types that convert a rate-based type to a spiking one. (#1609)RegularSpiking
neuron type, which emits regularly-spaced spikes at the rate specified by its base type. (#1609)StochasticSpiking
neuron type, which emits spikes based on stochastic rounding to roughly match the rate specified by its base type. (#1609)PoissonSpiking
neuron type, which emits Poisson-distributed spikes, as are commonly used to match biological spiking statistics. (#1609)PositiveNeuronType
test argument to run tests on all neuron types for which negative
is not True
. (#1609)QuasirandomSequence
distribution, which is similar to Uniform
but spreads points across the space evenly. (#1611)ScatteredHypersphere
distribution, which is similar to UniformHypersphere
but spreads points across the space more evenly. (#1611)RLS
(recursive least-squares) learning rule, which is an online version of the least-squares method typically used for offline decoder-solving. (#1611, example)SimProbe
operator, which marks a signal as being probed. (#1653)Changed
None
, meaning that there will be no transform applied. This only changes behavior when learning on a neuron-neuron connection with the default scalar transform. In that situation there are now no weights to apply learning to, so this will result in an error. The old behaviour can be obtained by setting transform=1
. (#1591).ensembles
, .connections
, .probes
) are now read-only, to prevent users from accidentally overwriting them with their own data. (#1545, #1608)NeuronType.step_math
method has been renamed to NeuronType.step
. (#1609)state
class attribute declares the neuron type's state variables and their default initial values. All __init__
methods accept an initial_state
dictionary for users to override the default initial state values. (#1609)nl
and nl_nodirect
test arguments have been renamed to AnyNeuronType
and NonDirectNeuronType
. (#1609)weights=True
) are now allowed on all connections. For connections that are not between Ensembles
, though, weight solvers have the same effects as solvers with weights=False
, and a warning will be raised. (#1626)EnsembleArray
now raises an error if add_output
would overwrite an existing attribute. (#1611)encoders
and eval_points
of Ensemble
are now sampled from ScatteredHypersphere
by default. (#1611)Deprecated
NeuronType.step
replaces the NeuronType.step_math
method, which will be removed in Nengo 4.0.0. (#1609)Connection.is_decoded
is deprecated, as the definition of whether a Connection is decoded or not was ambiguous. Instead we recommend directly checking the pre/post objects for the properties of interest. (#1640)Fixed
Ensemble.neurons
or Connection.learning_rule
objects. (#1588)Ensemble
. (#1598)Simulator
would rerun the optimizer. (#1598)LstsqDrop
solver errored when solving for zero weights. (#1541, #1607)Choice
distributions. (#1630)Signal
did not register as sharing memory with itself. (#1627)Added
fail_fast
setting to test operators when they are first added to the model. See configuration options for details. (#1532)--memory
option for pytest that prints the total memory consumed by the tests when they complete (Linux and Mac OS X only). (#640)Simulator.clear_probes
method to clear probe data. This method can be used before pickling to reduce the pickle file size. (#1387)allclose
fixture from pytest-allclose
, which makes it possible for backends to change test tolerances. (#1563)rng
and seed
fixtures from pytest-rng
. (#1566)plt
fixture from pytest-plt
. (#1566)nengo_simloader
pytest option for specifying a callable that takes a pytest request
and returns a callable to be used as Simulator
in the Nengo test suite. (#1566)Changed
dt
argument to Simulator.trange
with sample_every
because dt
would return values that the simulator had not simulated. dt
is now an alias for sample_every
and will be removed in the future. (#1368, #1384)Connection.transform
) will now be represented internally as nengo.Dense
objects. Arrays/scalars can still be passed as transform
values, and they will be automatically converted to the equivalent nengo.Dense
object. Retrieving the value of my_conn.transform
will return that Dense
object. The original input array can be retrieved through my_conn.transform.init
. (#1481)nengo.solvers.NoSolver(w, weights=True)
now expects w
to have shape (pre.n_neurons, function_d)
, rather than pre.n_neurons, post.n_neurons)
. That is, with NoSolver
you are always specifying the values for the decoders, and encoders/transform will be applied automatically to those decoders (as occurs with all other solvers). Note that this does not affect NoSolver(..., weights=False)
(the default). (#1481)settled_firingrate
function has been moved from nengo.utils.neurons
to nengo.neurons
. (#1187)nengo_test_unsupported
(replacing the previous Simulator.unsupported
functionality). (#1521)NeuronType.current
and NeuronType.rates
methods now document the supported shapes of parameters and return values. (#1437)NdarrayParam
now accepts a dtype
argument to check that data assigned to that parameter matches the given Numpy dtype
. DistOrArrayParam
accepts an analogous sample_dtype
argument. (#1532)fail_fast
RC setting. (#1532)LinearFilter
now uses state space representations internally, which is faster and potentially more accurate. (#1535)y0
in Synapse.filt
is now 0 instead of the initial value of the input signal. This allows unstable filters (e.g., integrators) to be used with filt
. (#1535)LinearFilter
now accepts the discretization method as an argument, rather than having it specified in make_step
. (#1535)synapse_kwargs
argument to FilteredNoise
has been removed. (#1535)make_state
method and accepting a state
parameter in make_step
. (#1387)Simulator
is now pickleable, allowing its state to be saved and loaded. (#1387)utils.testing.allclose
to utils.testing.signals_allclose
, to differentiate it from the allclose
fixture. (#1563)intercepts
value has been changed to Uniform(-1, 0.9)
to avoid high gains when intercepts are close to 1. (#1534, #1561)--simulator
and --neurons
pytest command line arguments are now specified by nengo_simulator
and nengo_neurons
entries in the pytest config file instead. (#1566)nengo_test_unsupported
option now uses pytest nodeids for the test names (the main change is that this means a double ::
between file and function names). (#1566)Signals
will now raise an error if their initial value contains NaNs. (#1571)simulator.ProbeDict
to simulator.SimulationData
. (#1574)Deprecated
nengo.spa
module. Use the Nengo SPA project instead. (#1465)A
and B
inputs to the Product
and CircularConvolution
networks are officially deprecated. Use input_a
and input_b
instead. (#887, #1179)nengo.utils.compat
will be removed in the next minor release. (#1520)utils.numpy.rmse
. Call utils.numpy.rms
on the difference between two arrays instead. (#1563)Removed
net
argument. To set network arguments like label
, pass them as keyword arguments instead. (#1179)generate_graphviz
utility function. It can now be found in nengo_extras. (#1187)probe_all
function. It can now be found in nengo_extras. (#1187)PES.correction
is no longer probeable. (#1398)rng
and seed
fixtures have been removed. Use the external pytest-rng package instead. (#1566)plt
fixture has been removed. Use the external pytest-plt package instead. (#1566)logger
fixture has been removed. Use pytest's log capturing instead. (#1566)nengo.log
and nengo.utils.logging
. Use the standard Python and pytest logging modules instead. (#1566)analytics
and analytics_data
fixtures have been removed. Use pytest's cache fixture instead. (#1566)RefSimulator
fixture has been removed. Use the Simulator
fixture and the nengo_test_unsupported
configuration option instead. (#1566)find_modules
and load_functions
from nengo.utils.testing
. Backends wanting to run Nengo test should use pytest --pyargs nengo
instead. (#1566)nengo.tests.options
. It is no longer necessary to use -p nengo.tests.options
when running Nengo tests. (#1566)nengo.conftest
. Use pytest configuration options instead. (#1566)*_tau
(e.g. pre_tau
) parameters from learning rules. Use *_synapse
instead. (#1577)neuron_nodes
argument from networks.EnsembleArray
. Use EnsembleArray.add_neuron_input/add_neuron_output
instead. (#1577)progress.updater
config option. Use progress.progress_bar
instead. (#1577)nengo.synapses.filt/filtfilt
functions. Use the Synapse.filt/filtfilt
methods instead. (#1577)utils.compat
. (#1577)utils.connection.target_function
. Target points can be passed directly to the Connection.function
argument instead. (#1577)utils.functions.piecewise
. Use nengo.processes.Piecewise
instead. (#1577)utils.testing.Mock
. (#1578)Fixed
FrozenObjects
can control parameter initialization order when copying, which fixed a bug encountered when copying convolutional connections. (#1493)size_in
/size_out
. (#1452, #1434)LinearFilter
synapses had unnecessary delays that have now been removed. (#1535)SpikingRectifiedLinear
neuron type now have their decoders cached. (#1550)ShapeParam
/TupleParam
can now be set to None
. (#1569)Ensemble.neurons
object. (#1582, #1583)Added
gain
and bias
along with either of max_rates
or intercepts
, as the latter two parameters are ignored. (#1431, #1433)Changed
Learning rules can now be sliced when providing error input. (#1365, #1385)
The order of parameters in learning rules has changed such that learning_rate
always comes first. (#1095)
Learning rules take pre_synapse
, post_synapse
, and theta_synapse
instead of pre_tau
, post_tau
, and theta_tau
respectively. This allows arbitrary Synapse
objects to be used as filters on learning signals. (#1095)
Deprecated
nengo.ipynb
IPython extension and the IPython2ProgressBar
have been deprecated and replaced by the IPython5ProgressBar
. This progress bar will be automatically activated in IPython and Jupyter notebooks from IPython version 5.0 onwards. (#1087, #1375)pre_tau
, post_tau
, and theta_tau
parameters for learning rules are deprecated. Instead, use pre_synapse
, post_synapse
, and theta_synapse
respectively. (#1095)Removed
Added
amplitude
parameter to LIF
, LIFRate
, and RectifiedLinear
which scale the output amplitude. (#1325, #1391)SpikingRectifiedLinear
neuron model. (#1391)Changed
Ensemble.n_neurons
or Ensemble.dimensions
. (#1372)Fixed
Model
instances. (#1135)nengo.Node
functions. (#1317)(*args, **kwargs)
could not be used in custom solvers. (#1358, #1359)Simulator.n_steps
and Simulator.time
properties now return scalars, as was stated in the documentation. (#1406)--seed-offset
option of the test suite. (#1409)Added
NoSolver
solver that can be used to manually pass in a predefined set of decoders or weights to a connection. (#1352)Piecewise
process, which replaces the now deprecated piecewise
function. (#1036, #1100, #1355, #1362)Changed
Fixed
ObjView
when using a weight solver. (#1317)ShapeParam
would always store None
. (#1342)Deprecated
piecewise
function in nengo.utils.functions
has been deprecated. Please use the Piecewise
process instead. (#1100)Added
n_neurons
property to Network
, which gives the number of neurons in the network, including all subnetworks. (#435, #1186)UniformHypersphere
. (#799)LinearFilter.combine
method to combine two LinearFilter
instances. (#1312)max_rates
and intercepts
given gain
and bias
. (#1334)Changed
size_in
parameter and attribute, allowing both integers and strings to define the dimensionality of the learning rule. This replaces the error_type
attribute. (#1307, #1310)EnsembleArray.n_neurons
now gives the total number of neurons in all ensembles, including those in subnetworks. To get the number of neurons in each ensemble, use EnsembleArray.n_neurons_per_ensemble
. (#1186)Connection
function returns None
is now more clear. (#1319)Connection
transform is set to None
. (#1326)Fixed
Added
optimize=False
to Simulator
. (#1035)Ensemble.normalize_encoders
to False
. (#1191, #1267)Samples
distribution to allow raw NumPy arrays to be passed in situations where a distribution is required. (#1233)Changed
Node
or Direct
ensemble produces a non-finite value. (#1178, #1280, #1286)label
of a network must be a string or None
, and that the seed
of a network must be an int or None
. This helps avoid situations where the seed would mistakenly be passed as the label. (#1277, #1275)ens_kwargs
argument of EnsembleArray
. Arrays are wrapped in a Samples
distribution internally. (#691, #766, #1233)tau_ref
) for the Sigmoid
neuron type has changed to 2.5 ms (from 2 ms) for better compatibility with the default maximum firing rates of 200-400 Hz. (#1248)Product
and CircularConvolution
networks have been renamed from A
and B
to input_a
and input_b
for consistency. The old names are still available, but should be considered deprecated. (#887, #1296)Fixed
Deprecated
net
argument to networks has been deprecated. This argument existed so that network components could be added to an existing network instead of constructing a new network. However, this feature is rarely used, and makes the code more complicated for complex networks. (#1296)Added
nengo.utils.network.activate_direct_mode
function to make it easier to activate direct mode in networks where some parts require neurons. (#1111, #1168)Fixed
Changed
IndexError
now to be consistent with standard Python behaviour. (#1176, #1183)