human
I am working on the file "SYDE 556 Lecture 9 Action Selection.ipynb".
The first task is:
That seems to introduce a new problem
The self-excitation is so strong that it can't respond to changes in the input
Indeed, any method like this is going to have some form of memory effects
Notice that what has been implemented is an integrator (sort of)

Could we do anything to help without increasing e too much?
Can you write Python program for it?

=====
Here has been implemented is an integrator (sort of)?
assistant
#Here has been implemented is an integrator (sort of)
.

%pylab inline
import nengo

def stimulus(t):
    if t<.3:
        return [.5,.4]
    elif .3<t<.5:
        return [.3,.5]
    else:
        return [0,0] 
    
model = nengo.Network('Selection')

with model:
    stim = nengo.Node(stimulus)
        
    s = nengo.Ensemble(200, dimensions=2)
    Qs = nengo.networks.EnsembleArray(50, n_ensembles=4)
    Action = nengo.networks.EnsembleArray(50, n_ensembles=4)
    
    nengo.Connection(s, Qs.input, transform=[[1,0],[-1,0],[0,1],[0,-1]])
    nengo.Connection(Qs.output, Action.input)
    
    e = 0.2
    i = -1

    recur = [[e, i, i, i], [i, e, i, i], [i, i, e, i], [i, i, i, e]]    

    def positive(x):
        if x[0]<0: return [0]
        else: return x
    pos = Action.add_output('positive', positive)
    
    nengo.Connection(pos, Action.input, transform=recur)
    
    def select(x):
        if x[0]>=0: return [1]
        else: return [0]
    sel = Action.add_output('select', select)
        
    aValues = nengo.networks.EnsembleArray(50, n_ensembles=4)
    
    nengo.Connection(sel, aValues.input)   
    nengo.Connection(stim, s)
    
    model.config[nengo.Probe].synapse = nengo.Lowpass(0.01)
    qs_p = nengo.Probe(Qs.output)
    action_p = nengo.Probe(Action.output)
    aValues_p = nengo.Probe(aValues.output)
    s_p = nengo.Probe(s)

from nengo_gui.ipython import IPythonViz
IPythonViz(model, "configs/action_selection2.py.cfg")

sim = nengo.Simulator(model)
sim.run(1.)

t = sim.trange()

plot(t, sim.data[s_p], label="state")
legend(loc='best')

figure()
plot(t, sim.data[qs_p], label='Qs')
legend(loc='best')

figure()
plot(t, sim.data[action_p], label='Action')
legend(loc='best')

figure()
plot(t, sim.data[aValues_p], label='Action Values')
legend(loc='best');