Yes, but you have to insert the connections manually and be aware that each SPA module usually uses multiple ensembles. This can be adjusted with the
subdimensions parameter. Set it to the full dimensionality to get things represented in a single ensemble, but comes with certain trade-offs (model will take longer and more memory to build, accuracy of the representation will be worse for the same number of neurons).
Example to create and get all the connections between the ensembles of two SPA states:
with spa.SPA() as find_weights:
find_weights.state1 = spa.State(d, seed=1)
find_weights.state2 = spa.State(d, seed=2)
connections = [nengo.Connection(e1, e2, seed=seed, solver=nengo.solvers.LstsqL2(weights=True))
for seed, (e1, e2) in enumerate(zip(
Usually you can do a cortical connection by just
nengo.Connection(find_weights.state1.output, find_weights.state2.input), but the
input objects are intermediary nodes that prevent you from getting the actual neuron to neuron connection weights.