Hello everyone, I’m trying to use PES for a simple data fitting task, and the code is as follows. However, the results are not satisfactory, with a large error. I have also tried adjusting the learning rate (from 1e-1 to 1e-3), but the results are still not ideal. How should I adjust in this situation? Additionally, I noticed that when fitting one-dimensional data, the error is much smaller. So, when the data dimensionality increases, how should I adjust to achieve better fitting results?The output of the above program is [0.14 0.19].
Best regards.
import numpy as np
import nengo
q = 2
model = nengo.Network()
Connection_PES = []
with model:
# -- input and pre popluation
inp = nengo.Node([-0.04, 0.13], size_out=2)
pre = nengo.Ensemble(300, dimensions=2)
post = nengo.Ensemble(300, dimensions=2)
error = nengo.Ensemble(300, dimensions=2)
nengo.Connection(inp[0], pre[0])
nengo.Connection(inp[1], pre[1])
nengo.Connection(inp[0], error[0])
nengo.Connection(inp[1], error[1])
nengo.Connection(post[0], error[0], transform=-1)
nengo.Connection(post[1], error[1], transform=-1)
nengo.Connection(pre, post, learning_rule_type=nengo.PES(learning_rate=1e-1))
post_probe = nengo.Probe(post)
with nengo.Simulator(model) as sim:
sim.run(10)
a = sim.data[post_probe]
print(a[-1, :])