Changeset 101 for trunk/examples/retina/benchmark_linear.py
- Timestamp:
- 01/15/08 17:44:22 (4 years ago)
- Files:
-
- 1 modified
-
trunk/examples/retina/benchmark_linear.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/retina/benchmark_linear.py
r97 r101 17 17 import retina as model 18 18 import NeuroTools.benchmark as benchmark 19 20 21 19 22 20 … … 43 41 44 42 N, N_ret, simtime = params['N'], params['N_ret'], params['simtime'] 45 N_smooth = 100 # how many time bins43 t_smooth = 100. # smooting time (ms) 46 44 47 45 for experiment in experiment_list: … … 50 48 except: 51 49 print "Loading data for experiment " , experiment 52 out_ON_DATA = benchmark.get('out',experiment)['out_ON_DATA'] 53 # ON 54 temporal_ON , lower_edges = numpy.histogram(out_ON_DATA.as_list_id_list_time()[1], 55 bins=N_smooth, range=(out_ON_DATA.t_start,out_ON_DATA.t_stop)) 56 temporal_ON /= N**2 57 # OFF : noit very useful here 58 #out_OFF_DATA = benchmark.get('out',experiment)['out_OFF_DATA'] 59 ## temporal_OFF , lower_edges = numpy.histogram(out_OFF_DATA.as_list_id_list_time()[1], 60 ## bins=N_smooth, range=(out_ON_DATA.t_start,out_ON_DATA.t_stop)) 61 ## temporal_OFF /= N**2 50 out_ON = benchmark.get('out',experiment)['out_ON_DATA'] 51 62 52 # storing 63 53 benchmark.put('firing_rate',{ 64 'temporal_ON' : temporal_ON,65 ## 'temporal_OFF' : temporal_OFF,66 'lower_edges' : lower_edges,54 'temporal_ON' : sum(out_ON.firing_rate(t_smooth))/N, 55 #'temporal_OFF' : out_OFF.firing_rate(t_smooth), 56 'lower_edges' : out_ON.time_axis(t_smooth), 67 57 'firing_rate_ok' : True # a flag to do it once 68 58 }, experiment ) … … 89 79 #pylab.legend() 90 80 91 pylab.savefig(benchmark.filename + '/benchmark_linear.p ng') #, dpi=300) #81 pylab.savefig(benchmark.filename + '/benchmark_linear.pdf') #, dpi=300) # 92 82 93 83 94 84 if __name__ == '__main__': 95 85 96 # not working tag= '07-02-16'97 # tag= '07-02-14'98 # tag= '07-02-23'99 tag= '07-02-27'100 tag = '07-03-08'101 tag = '07-05-09'102 86 tag = 'test' 103 87 … … 106 90 107 91 ret = model.Retina(21) 108 ret.params['simtime'] = 4000*0.1 109 ret.params['amplitude'] = numpy.ones((ret.params['N'],ret.params['N'] )) 110 111 run = benchmark.get_experiment_dict({'snr' : 10.**(numpy.linspace(-.50,.75,5))}) 112 92 #ret.params['simtime'] = 4000*0.1 93 ret.params['amplitude'] = numpy.ones(ret.params['N']) 94 N_exp = 15 95 snr = ret.params['snr']* numpy.linspace(0.1,2.0,N_exp) 96 run = benchmark.get_experiment_dict({'snr':snr}) 97 print snr#,ret.params 113 98 B = benchmark.Benchmark(filename,ret,run) 114 99 115 100 B.run_simulations() 116 101 show(B) 117 102 #B.reset_all()
