Changeset 326 for trunk/examples/retina/benchmark_linear.py
- Timestamp:
- 11/12/08 19:49:46 (4 years ago)
- Files:
-
- 1 modified
-
trunk/examples/retina/benchmark_linear.py (modified) (3 diffs, 1 prop)
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/retina/benchmark_linear.py
- Property svn:keywords set to Id
r220 r326 19 19 20 20 N, N_exp = 1000, 6 21 p = ParameterSet({})22 21 t_smooth = 100. # width (in ms) of the integration window 23 22 from retina import * 24 23 retina = Retina(N) 24 retina.params['amplitude'] = 1 25 snr = retina.params['snr']* numpy.linspace(0.1,2.0,N_exp) 26 p = ParameterSpace({'snr' : ParameterRange(list(snr))}) 27 25 28 26 29 name = sys.argv[0].split('.')[0] # name of the current script withpout the '.py' part … … 33 36 34 37 except: 35 snr = retina.params['snr']* numpy.linspace(0.1,2.0,N_exp) 36 p.snr = ParameterRange(list(snr)) 38 37 39 # calculates the dimension of the parameter space 38 40 results_dim, results_label = p.parameter_space_dimension_labels() … … 78 80 79 81 """ 80 pylab.close('all') 81 pylab.rcParams.update(pylab_params(fig_width_pt = 497.9/2., ratio = 1.)) 82 pylab.figure(num = 1, dpi=150, facecolor='w', edgecolor='k') 83 Lmargin, Rmargin, dmargin, umargin = 0.2, 0.05, 0.15, 0.05 84 pylab.axes([Lmargin, dmargin , 1.0 - Rmargin- Lmargin,1.0-umargin-dmargin]) # [left, bottom, width, height] 82 #pylab.close('all') 83 #pylab.rcParams.update(pylab_params(fig_width_pt = 497.9/2., ratio = 1.)) 84 pylab.figure(1) 85 fmax = numpy.max([numpy.max(temporal_OFF[:]),numpy.max(temporal_ON[:])]) 85 86 87 pylab.subplot(211) 86 88 for i_exp in range(N_exp): 87 pylab.plot(lower_edges, # TODO add a half bin 88 temporal_ON[i_exp])#, 89 # label= 'snr=' + str(benchmark.get('experiments')[experiment]['snr'])) 90 #pylab.subplot(121) 91 #pylab.title('time course')# ON 89 pylab.plot(lower_edges[:-1] + t_smooth/2, # TODO add a half bin 90 temporal_ON[i_exp])# 92 91 pylab.xticks( numpy.round(numpy.linspace(0, retina.params.simtime, 5),0) ) 93 pylab.ylabel('Firing frequency (Hz)') 92 pylab.ylabel('ON Firing frequency (Hz/neuron)') 93 pylab.axis([0, retina.params.simtime, 0.0, fmax]) 94 pylab.subplot(212) 95 for i_exp in range(N_exp): 96 pylab.plot(lower_edges[:-1] + t_smooth/2, # TODO add a half bin 97 temporal_OFF[i_exp], 98 label= 'snr= %5.3f' % p.snr._values[i_exp] ) 99 pylab.xticks( numpy.round(numpy.linspace(0, retina.params.simtime, 5),0) ) 100 pylab.ylabel('OFF Firing frequency (Hz/neuron)') 94 101 pylab.xlabel('time (ms)') 95 pylab.axis( 'tight')102 pylab.axis([0, retina.params.simtime, 0.0, fmax ]) 96 103 97 #pylab.legend()104 pylab.legend(loc='upper right') 98 105 99 #pylab.subplot(122)100 #pylab.title('time course OFF')101 #pylab.xticks( numpy.linspace(0, simtime, 5) )102 #pylab.ylabel('firing frequency (Hz)')103 #pylab.axis('tight')104 #pylab.xlabel('time (ms)')105 #pylab.legend()106 106 107 pylab.savefig('results/fig-' + name + '.pdf') 108 pylab.savefig('results/fig-' + name + '.png', dpi = 300) 107 if 0: 108 pylab.ion() 109 #pylab.show() 110 else: 111 pylab.savefig('results/fig-' + name + '.pdf') 112 pylab.savefig('results/fig-' + name + '.png', dpi = 300) 109 113 110 #TODO: make a plot showing it's the right point process with a histogram
