Show
Ignore:
Timestamp:
01/15/08 17:44:22 (4 years ago)
Author:
LaurentPerrinet
Message:

Finished examples of use of NeuroTools: retina / renamd SpikeTrain.mean_firing_rate to SpikeTrain.mean_rate for consistency with SpikeList.mean_rate / bugfix in spikes.py for the definition of a range in SpikeTrain.mean_rate

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/examples/retina/benchmark_noise.py

    r97 r101  
    3535    noise_std, CRF = numpy.zeros(len(experiments)), numpy.zeros(len(experiments)) 
    3636    for count, experiment in enumerate(experiments): 
    37         out_ON_DATA = benchmark.get('out',experiment)['out_ON_DATA']#.as_list_id_list_time() 
     37        out_ON_DATA = benchmark.get('out',experiment)['out_ON_DATA'] 
    3838        noise_std[count] = benchmark.get('experiments')[experiment]['noise_std'] 
    39         CRF[count] = out_ON_DATA.mean_rate()#[0]) / N / N / simtime * 1000.0 
     39        CRF[count] = out_ON_DATA.mean_rate() 
    4040 
    4141 
     
    4848    #pylab.axes([Lmargin, dmargin , 1.0 - Rmargin- Lmargin,1.0-umargin-dmargin]) # [left, bottom, width, height] 
    4949 
    50     #pylab.subplot(111) 
    5150    idx_ = numpy.argsort(noise_std) # extract lines 
    5251    pylab.plot(noise_std[idx_],CRF[idx_],'go-', label='line 1', linewidth=2) 
     
    6564    # create a Retina Model object that contains a method to init, to run, ... 
    6665    ret = model.Retina(10) 
    67     ret.params['simtime'] = 4000*0.1 
    6866 
    69     tag = '07-02-21' 
    70     tag = '07-03-08' # worked fine for D25 
    71     tag = '07-04-12' 
    72     tag = '07-04-08' # new with multiple seeds for CNS07 
    73     tag = '07-05-14' # no 
    74     tag = '07-05-16' # going OO 
    75     tag = 'test' # going OO 
     67    tag = 'test' 
    7668 
    7769    name = 'results/' + tag + '_benchmark_noise' 
    7870 
    7971    # create the list of experiments as all possibilities accross parameter vectors 
    80     run = benchmark.get_experiment_dict({'noise_std':numpy.linspace(.10,10.0,20), 'snr' : [ 0.0 ]}) 
     72    span, N_exp = 5, 2*7+1 
     73    #range = 10.**(numpy.linspace(-span,span,N_exp)) 
     74    range = numpy.linspace(1/span,span,N_exp) 
     75    run = benchmark.get_experiment_dict({'noise_std': ret.params['noise_std']* range, 'snr' : [ 0.0 ]}) 
    8176 
    8277    # create benchmark (or open it if it exists) 
     
    8681 
    8782    show(B) 
    88  
     83    #B.reset_all() # erase experimental data