try: temporal_ON = results['temporal_ON'] temporal_OFF = results['temporal_OFF'] lower_edges = results['lower_edges'] params = results['params'] #if (params == retina.params): raise('Parameters have changed') except: from retina import * retina = Retina(N) retina.params['amplitude'] = numpy.ones(retina.params['amplitude'].shape) # calculates the dimension of the parameter space results_dim, results_label = p.parameter_space_dimension_labels() # creates results array with size of parameter space dimension data = retina.run(retina.params,verbose=False) lower_edges = data['out_ON_DATA'].time_axis(t_smooth) N_smooth = len(lower_edges) temporal_ON, temporal_OFF = [],[] import progressbar # see http://projects.scipy.org/pipermail/scipy-dev/2008-January/008200.html pbar=progressbar.ProgressBar(widgets=[name, " ", progressbar.Percentage(), ' ', progressbar.Bar(), ' ', progressbar.ETA()], maxval=N_exp) for i_exp,experiment in enumerate(p.iter_inner()): params = retina.params params.update(experiment) # updates what changed in the dictionary # simulate the experiment and get its data data = retina.run(params,verbose=False)
from NeuroTools.sandbox import make_name # creating a ParameterSpace p = ParameterSpace({}) # adding fixed parameters p.nu = 20. # rate [Hz] p.duration = 1000. # adding ParameterRanges p.c = ParameterRange([0.0,0.01,0.1,0.5]) p.jitter = ParameterRange([0.0,1.0,5.0,]) # calculation of the ParameterSpace dimension and the labels of the parameters # containing a range dims, labels = p.parameter_space_dimension_labels() print "dimensions: ", dims print ' labels: ', labels def calc_cc(p): """ Generate correlated spike trains from the ParameterSet. Parameter: p - ParameterSet containing parameters nu (rate), c (correlation), duration (in ms), jitter (in ms). Returns: (cc, time_axis_cc, corrcoef) cc - correlation coefficient time_axis_cc - time axis for cross-correlation (for plotting) corrcoef - correlation coefficient between the two SpikeTrains
# adding fixed parameters p.nu = 20. # rate [Hz] p.duration = 1000. # adding ParameterRanges p.c = ParameterRange([0.0, 0.01, 0.1, 0.5]) p.jitter = ParameterRange([ 0.0, 1.0, 5.0, ]) # calculation of the ParameterSpace dimension and the labels of the parameters # containing a range dims, labels = p.parameter_space_dimension_labels() print "dimensions: ", dims print ' labels: ', labels def calc_cc(p): """ Generate correlated spike trains from the ParameterSet. Parameter: p - ParameterSet containing parameters nu (rate), c (correlation), duration (in ms), jitter (in ms). Returns: (cc, time_axis_cc, corrcoef) cc - correlation coefficient time_axis_cc - time axis for cross-correlation (for plotting)
results = shelve.open('results/mat-' + name) try: temporal_ON = results['temporal_ON'] temporal_OFF = results['temporal_OFF'] lower_edges = results['lower_edges'] params = results['params'] #if (params == retina.params): raise('Parameters have changed') except: from retina import * retina = Retina(N) retina.params['amplitude'] = numpy.ones(retina.params['amplitude'].shape) # calculates the dimension of the parameter space results_dim, results_label = p.parameter_space_dimension_labels() # creates results array with size of parameter space dimension data = retina.run(retina.params, verbose=False) lower_edges = data['out_ON_DATA'].time_axis(t_smooth) N_smooth = len(lower_edges) temporal_ON, temporal_OFF = [], [] import progressbar # see http://projects.scipy.org/pipermail/scipy-dev/2008-January/008200.html pbar = progressbar.ProgressBar(widgets=[ name, " ", progressbar.Percentage(), ' ', progressbar.Bar(), ' ', progressbar.ETA() ], maxval=N_exp)