Пример #1
0
    'DsInh_a': 0.,
    'DsInh_b': 0.,
    'DsInh_tauw': 1e9,
}

if sys.argv[-1] == 'plot':
    # ######################
    # ## ----- Plot ----- ##
    # ######################

    # vision_model = ntwk.earlyVis_model(from_file='drifting-grating-data.npz')
    # ps = ntwk.vision_plot(model=vision_model)
    # fig0 = ps.protocol_plot()

    ## load file
    data = ntwk.load_dict_from_hdf5('visual_input_data.h5')

    print(data['iRASTER_AffExc'])
    print(data['tRASTER_AffExc'])

    # ## plot
    fig, _ = ntwk.raster_and_Vm_plot(data, ['Exc', 'Inh', 'DsInh', 'AffExc'],
                                     smooth_population_activity=10.)
    ntwk.show()

else:

    if False:

        params = ntwk.vision_params.copy()
        params['rf_theta'] = [3 * np.pi / 12., 5. * np.pi / 12.]
Пример #2
0
    'DsInh_Vreset': -70.,
    'DsInh_deltaV': 0.,
    'DsInh_a': 0.,
    'DsInh_b': 0.,
    'DsInh_tauw': 1e9
}

if __name__ == '__main__':

    import sys
    sys.path.append('../..')
    import main as ntwk

    if sys.argv[-1] == 'plot':
        ## load file
        data = ntwk.load_dict_from_hdf5('CellRep2019_data.h5')
        print(data)
        # ## plot
        fig, _ = ntwk.raster_and_Vm_plot(data, smooth_population_activity=10.)
        ntwk.show()

    else:
        import numpy as np
        from analyz.processing.signanalysis import smooth

        NTWK = ntwk.build_populations(Model, ['RecExc', 'RecInh', 'DsInh'],
                                      AFFERENT_POPULATIONS=['AffExc'],
                                      with_raster=True,
                                      with_Vm=4,
                                      verbose=True)
Model['p_AffExc_recInh'] = 0.2
Model['p_AffExc_pyrExc'] = 0.05
# ==> NoiseExc
Model['p_NoiseExc_recInh'] = 0.1
Model['p_NoiseExc_pyrExc'] = 0.02
Model['p_NoiseExc_dsInh'] = 0.02
Model['p_NoiseExc_oscillExc'] = 0.2

if sys.argv[-1] == 'plot':

    ######################
    ## ----- Plot ----- ##
    ######################

    ## load file
    data = ntwk.load_dict_from_hdf5('mean_field_data.h5')

    # ## plot
    fig, _ = ntwk.activity_plots(data, smooth_population_activity=10)

    ntwk.show()

elif sys.argv[-1] == 'mf':

    data = ntwk.load_dict_from_hdf5('mean_field_data.h5')

    tstop, dt = 1e-3 * data['tstop'], 1e-2
    t = np.arange(int(tstop / dt)) * dt

    DYN_SYSTEM, INPUTS = {}, {}
    for rec in REC_POPS:
Пример #4
0
    # --> Inhibitory population (Inh, recurrent inhibition)
    'Inh_Gl': 10.,
    'Inh_Cm': 200.,
    'Inh_Trefrac': 3.,
    'Inh_El': -60.,
    'Inh_Vthre': -50.,
    'Inh_Vreset': -60.,
    'Inh_delta_v': 0.,
    'Inh_a': 0.,
    'Inh_b': 0.,
    'Inh_tauw': 1e9,
}

if sys.argv[-1] == 'plot':
    ## load file
    data = ntwk.load_dict_from_hdf5('Vogels-Abbott.h5')
    print('excitatory firing activity: ',
          1e3 * len(data['iRASTER_Exc']) / data['tstop'] / data['N_Exc'])
    print('inhibitory firing activity: ',
          1e3 * len(data['iRASTER_Inh']) / data['tstop'] / data['N_Inh'])
    ## plot
    fig, AX = plt.subplots(2)
    AX[0].plot(data['tRASTER_Exc'], data['iRASTER_Exc'], 'bo', ms=2)
    AX[0].plot(data['tRASTER_Inh'], -data['iRASTER_Inh'], 'ro', ms=2)
    ntwk.set_plot(AX[0], [], xticks=[], yticks=[])
    for v in data['VMS_Exc']:
        AX[1].plot(np.arange(len(v)) * data['dt'], v, 'k-', lw=1)
    ntwk.set_plot(AX[1], xlabel='time (ms)', ylabel='Vm (mV)')
    ntwk.show()

else:
    'Inh_El': -60.,
    'Inh_Vthre': -53.,
    'Inh_Vreset': -60.,
    'Inh_deltaV': 0.,
    'Inh_a': 0.,
    'Inh_b': 0.,
    'Inh_tauw': 1e9,
}

if sys.argv[-1] == 'plot':
    # ######################
    # ## ----- Plot ----- ##
    # ######################

    ## load file
    data = ntwk.load_dict_from_hdf5('with_correl_drive_data.h5')

    # ## plot
    fig, _ = ntwk.raster_and_Vm_plot(data, smooth_population_activity=10.)

    plt.show()

else:

    NTWK = ntwk.build_populations(
        Model,
        ['Exc', 'Inh'],
        AFFERENT_POPULATIONS=['AffExc'],
        with_raster=True,
        with_Vm=4,
        # with_synaptic_currents=True,
    'DsInh_El': -60.,
    'DsInh_Vthre': -53.,
    'DsInh_Vreset': -60.,
    'DsInh_deltaV': 0.,
    'DsInh_a': 0.,
    'DsInh_b': 0.,
    'DsInh_tauw': 1e9,
}

if sys.argv[-1] == 'plot':
    # ######################
    # ## ----- Plot ----- ##
    # ######################

    ## load file
    data = ntwk.load_dict_from_hdf5('3pop_model_data.h5')

    # ## plot
    fig, _ = ntwk.activity_plots(data, smooth_population_activity=10.)

    plt.show()
else:
    NTWK = ntwk.build_populations(
        Model,
        ['Exc', 'Inh', 'DsInh'],
        AFFERENT_POPULATIONS=['AffExc'],
        with_raster=True,
        with_Vm=4,
        # with_synaptic_currents=True,
        # with_synaptic_conductances=True,
        verbose=True)
Пример #7
0
    # --> Inhibitory population (Inh, recurrent inhibition)
    'Inh_Gl': 10.,
    'Inh_Cm': 200.,
    'Inh_Trefrac': 5.,
    'Inh_El': -70.,
    'Inh_Vthre': -50.,
    'Inh_Vreset': -70.,
    'Inh_delta_v': 0.5,
    'Inh_a': 0.,
    'Inh_b': 0.,
    'Inh_tauw': 1e9,
}

if sys.argv[-1] == 'plot':
    ## load file
    data = ntwk.load_dict_from_hdf5('RS-FS.h5')
    print('excitatory firing activity: ',
          1e3 * len(data['iRASTER_Exc']) / data['tstop'] / data['N_Exc'])
    print('inhibitory firing activity: ',
          1e3 * len(data['iRASTER_Inh']) / data['tstop'] / data['N_Inh'])
    ## plot
    fig, AX = plt.subplots(2)
    AX[0].plot(data['tRASTER_Exc'], data['iRASTER_Exc'], 'bo', ms=2)
    AX[0].plot(data['tRASTER_Inh'], -data['iRASTER_Inh'], 'ro', ms=2)
    ntwk.set_plot(AX[0], [], xticks=[], yticks=[])
    for v in data['VMS_Exc']:
        AX[1].plot(np.arange(len(v)) * data['dt'], v, 'k-', lw=1)
    ntwk.set_plot(AX[1], xlabel='time (ms)', ylabel='Vm (mV)')
    ntwk.show()

else:
    'VIPInh_El': -60.,
    'VIPInh_Vthre': -53.,
    'VIPInh_Vreset': -60.,
    'VIPInh_deltaV': 0.,
    'VIPInh_a': 0.,
    'VIPInh_b': 0.,
    'VIPInh_tauw': 1e9,
}

if sys.argv[-1] == 'plot':
    # ######################
    # ## ----- Plot ----- ##
    # ######################

    ## load file
    data = ntwk.load_dict_from_hdf5('sinusoidal_input_data.h5')
    data['iRASTER_L4Exc'] = data['iRASTER_PRE1']
    data['tRASTER_L4Exc'] = data['tRASTER_PRE1']
    # # ## plot
    fig, _ = ntwk.activity_plots(
        data,
        POP_KEYS=['L23Exc', 'PVInh', 'SOMInh', 'VIPInh'],
        COLORS=['green', 'red', 'orange', 'purple'],
        smooth_population_activity=10.)
    plt.show()
else:
    NTWK = ntwk.build_populations(Model,
                                  ['L23Exc', 'PVInh', 'SOMInh', 'VIPInh'],
                                  AFFERENT_POPULATIONS=['L4Exc'],
                                  with_raster=True,
                                  with_Vm=4,
    # --> Disinhibitory population (Inh, recurrent inhibition)
    'oscillExc_Gl':10., 'oscillExc_Cm':200.,'oscillExc_Trefrac':3.,
    'oscillExc_El':-70., 'oscillExc_Vthre':-50., 'oscillExc_Vreset':-70., 'oscillExc_deltaV':0.,
    'oscillExc_Ioscill_amp':20.*10, 'oscillExc_Ioscill_freq': 3.,
    'oscillExc_a':0., 'oscillExc_b': 0., 'oscillExc_tauw':1e9,
}



if sys.argv[-1]=='plot':
    # ######################
    # ## ----- Plot ----- ##
    # ######################
    
    ## load file
    data = ntwk.load_dict_from_hdf5('rhythmic_ntwk_data.h5')

    # ## plot
    fig, _ = ntwk.raster_and_Vm_plot(data, smooth_population_activity=10.)
    
    plt.show()

else:

    NTWK = ntwk.build_populations(Model, ['Exc', 'Inh', 'oscillExc'],
                                  AFFERENT_POPULATIONS=['AffExc'],
                                  with_raster=True,
                                  with_pop_act=True,
                                  with_Vm=4,
                                  # with_synaptic_currents=True,
                                  # with_synaptic_conductances=True,
Пример #10
0
    'Inh_El': -70.,
    'Inh_Vthre': -50.,
    'Inh_Vreset': -70.,
    'Inh_deltaV': 0.5,
    'Inh_a': 0.,
    'Inh_b': 0.,
    'Inh_tauw': 1e9,
}

if sys.argv[-1] == 'plot':
    # ######################
    # ## ----- Plot ----- ##
    # ######################

    ## load file
    data = ntwk.load_dict_from_hdf5('ring_ntwk_data.h5')

    # ## plot
    fig, _ = ntwk.raster_and_Vm_plot(data, smooth_population_activity=10.)

    plt.show()

else:

    NTWK = ntwk.build_populations(
        Model,
        ['Exc', 'Inh'],
        AFFERENT_POPULATIONS=['AffExc'],
        with_raster=True,
        with_Vm=4,
        # with_synaptic_currents=True,
Пример #11
0
    'Inh_Gl': 10.,
    'Inh_Cm': 200.,
    'Inh_Trefrac': 3.,
    'Inh_El': -60.,
    'Inh_Vthre': -50.,
    'Inh_Vreset': -60.,
    'Inh_deltaV': 0.,
    'Inh_a': 0.,
    'Inh_b': 0.,
    'Inh_tauw': 1e9,
}

if sys.argv[-1] == 'plot':

    ## load file
    data = ntwk.load_dict_from_hdf5('coba_LIF_data.h5')
    print('excitatory firing activity: ',
          1e3 * len(data['iRASTER_Exc']) / data['tstop'] / data['N_Exc'])
    print('inhibitory firing activity: ',
          1e3 * len(data['iRASTER_Inh']) / data['tstop'] / data['N_Inh'])

    # ## plot
    fig, _ = ntwk.raster_and_Vm_plot(data, smooth_population_activity=10.)

    plt.show()

else:
    ## we build and run the simulation
    NTWK = ntwk.build_populations(
        Model,
        ['Exc', 'Inh'],