예제 #1
0
def parameter_scan(p=None):
    if p is None:
        p = default_parameters()
    #p.K2 = ParameterRange([0.7,0.0])
    #p.dt = ParameterRange([1.,6.77,10.,1000.]) # ms
    #p.td = ParameterRange([0.])#,6.,20.])
    #p.t1 = ParameterRange([0.]) # ms
    #p.t2 = ParameterRange([0.]) # ms
    #g = 0.8
    #p.c1 = ParameterRange([0.14*g])
    #p.c2 = ParameterRange([0.12*g])
    p.sigma_c = ParameterRange([0.1,0.4,0.8])
    
    create_figure()
    
    for experiment in p.iter_inner():
        name = make_name(experiment,p.range_keys())
        print name
        plot_receptive_field(p=experiment,label=name)
# creating a results array, with the dimensions of the ParameterSpace
corrcoef_results = numpy.empty(dims)

# scanning the ParameterSpace
for experiment in p.iter_inner():
    # calculation of the index in the space
    index = p.parameter_space_index(experiment)
    # perfomring the experiment
    cc,time_axis_cc, corrcoef = calc_cc(experiment)
    corrcoef_results[index] = corrcoef
    # plotting the cc's
    subplot_index = (dims[1]*index[0])+index[1]
    pylab.subplot(dims[0],dims[1],subplot_index+1)
    pylab.plot(time_axis_cc,cc)
    pylab.title(make_name(experiment,p.range_keys()))
    pylab.xlim(-30,30.)
    pylab.ylim(0,10.)


# plot the results
pylab.matshow(corrcoef_results)
pylab.xticks(numpy.arange(0.5,dims[1]+0.5,1.0),[str(i) for i in p.jitter._values])
pylab.yticks(numpy.arange(0.5,dims[0]+0.5,1.0),[str(i) for i in p.c._values])
pylab.xlim(0,dims[1])
pylab.ylim(dims[0],0)
pylab.xlabel('jitter (ms)')
pylab.ylabel('correlation')
ax = pylab.colorbar()
ax.set_label('correlation')
pylab.draw()
예제 #3
0
# creating a results array, with the dimensions of the ParameterSpace
corrcoef_results = numpy.empty(dims)

# scanning the ParameterSpace
for experiment in p.iter_inner():
    # calculation of the index in the space
    index = p.parameter_space_index(experiment)
    # perfomring the experiment
    cc, time_axis_cc, corrcoef = calc_cc(experiment)
    corrcoef_results[index] = corrcoef
    # plotting the cc's
    subplot_index = (dims[1] * index[0]) + index[1]
    pylab.subplot(dims[0], dims[1], subplot_index + 1)
    pylab.plot(time_axis_cc, cc)
    pylab.title(make_name(experiment, p.range_keys()))
    pylab.xlim(-30, 30.)
    pylab.ylim(0, 10.)

# plot the results
pylab.matshow(corrcoef_results)
pylab.xticks(numpy.arange(0.5, dims[1] + 0.5, 1.0),
             [str(i) for i in p.jitter._values])
pylab.yticks(numpy.arange(0.5, dims[0] + 0.5, 1.0),
             [str(i) for i in p.c._values])
pylab.xlim(0, dims[1])
pylab.ylim(dims[0], 0)
pylab.xlabel('jitter (ms)')
pylab.ylabel('correlation')
ax = pylab.colorbar()
ax.set_label('correlation')
예제 #4
0
# Parameters for running
p.timestep = 0.1
p.min_delay = 0.1
p.max_delay = 5.1
p.runtime = 500000.

# Parameters for number and connections
p.r0 = 1400.  # excitatory input rate
p.ri = 1647.  # inhibitory input rate
p.je = 0.015  # excitatory synaptic weight
p.ji = -0.015  # inhibitory synaptic weight
p.cb = ParameterRange(numpy.arange(
    1., 1.001,
    0.05))  # between-cell correlation of background input (NSD input)
p.N = 1000  # number of daughter cells for MIP
p.r = ParameterRange(numpy.arange(100., 101., 400.))  # MIP rate
p.c = ParameterRange(numpy.array([0.05]))  # with-pool correlation in MIP
p.q = ParameterRange(numpy.arange(
    0.2, 0.2501, 0.05))  # between-cell correlation of MIP input (SD input)
p.edge = ParameterRange(numpy.array([0.]))  # range of temporal jitter of MIP

dims, labels = p.parameter_space_dimension_labels()
results = numpy.empty(dims)
for experiment in p.iter_inner():
    name = make_name(experiment, p.range_keys())
    print name
    model = st.Striatum()
    model.run(sim, experiment, name)
    index = p.parameter_space_index(experiment)
    results[index] = 0