You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A synapse (that is not directly configurable) is created on this connection to the output node. This results in slightly different results between FpgaPesEnsembleNetwork and a corresponding Ensemble both with the same nengo.Simulator. A workaround is to configure fpga_pes_ensemble_network.connection.synapse = None after creating the network.
Here's a quick unit test that demonstrates identical behaviour with this work-around:
importnengofromnengo_fpga.networksimportFpgaPesEnsembleNetworkn=1neuron_type=nengo.SpikingRectifiedLinear()
rate=100probe_tau=0.1sim_t=20# 1) Nengo Ensemble implementationwithnengo.Network() asmodel1:
a1=nengo.Ensemble(
n_neurons=n,
dimensions=1,
neuron_type=neuron_type,
gain=np.zeros(n),
bias=rate*np.ones(n),
)
p1=nengo.Probe(a1.neurons, synapse=probe_tau)
# 2) Equivalent FpgaPesEnsembleNetwork implementationwithnengo.Network() asmodel2:
a2=FpgaPesEnsembleNetwork(
fpga_name='foobar',
n_neurons=n,
dimensions=n,
learning_rate=0,
)
a2.ensemble.gain=np.zeros(n)
a2.ensemble.bias=rate*np.ones(n)
a2.ensemble.neuron_type=neuron_typea2.connection.solver=nengo.solvers.NoSolver(np.eye(n))
a2.connection.synapse=None# <- this is the important linep2=nengo.Probe(a2.output, synapse=probe_tau)
# Compare for equality using the same simulatorwithnengo.Simulator(model1) assim1:
sim1.run_steps(sim_t)
withnengo.Simulator(model2) assim2:
sim2.run_steps(sim_t)
assertnp.allclose(sim1.data[p1], sim2.data[p2])
The text was updated successfully, but these errors were encountered:
Found some unexpected behaviour with the above example. If I switch the second simulator to nengo_fpga.Simulator, the fpga_name to an existing board, and a2.connection.synapse to something other than None, then that synapse appears to be ignored. For instance, moving the probe_tau from the probe to the connection does not seem to work (the output is still spikes).
nengo-fpga/nengo_fpga/networks/fpga_pes_ensemble_network.py
Lines 185 to 188 in a19a29a
A synapse (that is not directly configurable) is created on this connection to the output node. This results in slightly different results between
FpgaPesEnsembleNetwork
and a correspondingEnsemble
both with the samenengo.Simulator
. A workaround is to configurefpga_pes_ensemble_network.connection.synapse = None
after creating the network.Here's a quick unit test that demonstrates identical behaviour with this work-around:
The text was updated successfully, but these errors were encountered: