Changeset 166 for trunk/examples/retina/benchmark_noise.py
- Timestamp:
- 05/07/08 18:56:23 (4 years ago)
- Files:
-
- 1 modified
-
trunk/examples/retina/benchmark_noise.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/retina/benchmark_noise.py
r165 r166 13 13 """ 14 14 15 import os, datetime, numpy 16 import retina as model 15 import os, datetime, numpy, shelve 17 16 18 17 from NeuroTools.parameters import * … … 22 21 import progressbar # see http://projects.scipy.org/pipermail/scipy-dev/2008-January/008200.html 23 22 23 N, N_exp_noise = 100, 22 24 24 p = ParameterSet({}) 25 N, N_exp_noise = 10, 2226 25 p.noise_std = ParameterRange(list(10.**(numpy.linspace(-.50,1.,N_exp_noise)))) 27 retina = model.Retina(N)28 retina.params['snr'] = 029 26 30 27 results = shelve.open('results/benchmark_noise') … … 32 29 CRF = results['CRF'] 33 30 except: 31 import retina as model 34 32 33 34 retina = model.Retina(N) 35 retina.params['snr'] = 0 35 36 # calculates the dimension of the parameter space 36 37 results_dim, results_label = p.parameter_space_dimension_labels() … … 50 51 index = p.parameter_space_index(experiment) 51 52 # put the data at the right position in the results array 52 CRF[index] = data .mean_rate()#53 CRF[index] = data['out_ON_DATA'].mean_rate()# 53 54 pbar.update(i_exp) 54 55 … … 80 81 #pylab.axes([Lmargin, dmargin , 1.0 - Rmargin- Lmargin,1.0-umargin-dmargin]) # [left, bottom, width, height] 81 82 82 idx_ = numpy.argsort(noise_std) # extract lines 83 pylab.plot(noise_std[idx_],CRF[idx_],'go-', label='line 1', linewidth=2) 83 pylab.plot(p.noise_std._values,CRF,'go-', label='line 1', linewidth=2) 84 84 pylab.ylabel('Firing Frequency (Hz)') 85 85 pylab.xlabel('Noise amplitude')
