Since you are using tf.layers.dense
, the weights are being managed internally by TensorFlow. So there isn’t an easy way to access them using Nengo syntax, you would have to use one of the TensorFlow methods.
However, because you are using a dense transform, there isn’t actually any need to use tf.layers
. You could use the equivalent
x = nengo.Ensemble(256, 1, neuron_type=neuron_type)
conn = nengo.Connection(inp, x.neurons, transform=nengo_dl.dists.Glorot(),
synapse=None)
and then you’d be able to access the trained weights via
with nengo_dl.Simulator(...)
sim.train(...)
my_weights = sim.data[conn].weights