When I tried the example of @tcstewar in Nengo Summer School Lecture 5, I encountered several problems that I couldn’t understand:
My code:
import nengo
model = nengo.Network()
with model:
stim_food = nengo.Node([0, 0])
stim_fear = nengo.Node(-1)
food = nengo.Ensemble(n_neurons=100, dimensions=2)
do_food = nengo.Ensemble(n_neurons=300, dimensions=3)
motor = nengo.Ensemble(n_neurons=100, dimensions=2)
fear = nengo.Ensemble(n_neurons=100, dimensions=1)
do_home = nengo.Ensemble(n_neurons=300, dimensions=3)
nengo.Connection(stim_food, food)
nengo.Connection(stim_fear, fear)
nengo.Connection(fear, do_food[0])
nengo.Connection(food, do_food[1:])
def fear_func(x):
fear, food_x, food_y = x
if fear > 0:
return 0, 0
else:
return food_x, food_y
nengo.Connection(do_food, motor, function=fear_func)
pos = nengo.Ensemble(n_neurons=500, dimensions=2, radius=1)
nengo.Connection(pos, pos, synapse=0.1)
nengo.Connection(motor, pos, synapse=0.1, transform=0.1)
def home_func(x):
fear, pos_x, pos_y = x
if fear > 0:
return -pos_x, -pos_y
else:
return 0, 0
nengo.Connection(fear, do_home[0])
nengo.Connection(pos, do_home[1:])
nengo.Connection(do_home, motor, function=home_func)
-
After I complete the code for this task, I start by placing the fear slider at -1.Adjust the x and y sliders in stim_food while running the model simulation, and then place the fear slider to 1.However, at the moment thefear slider is placed to 1, a strange phenomenon appears in the xy-value of the motor module: as shown in the figure, the xy coordinates of the motor module will change to -x and -y instantly and then slowly return to the origin.
-
When I tried to adjust the fear slider, I found that the maximum radius of the XY-value blue dot moving in the motor module seemed to change.
-
Despite listening to @tcstewar and @celiasmith , I’m still not familiar with the synapse parameter in the nengo.Connection () function.
Is there anyone who understands my above three questions and can explain them to me?Thank you very much!