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)

        ntwk.build_up_recurrent_connections(NTWK, SEED=5, verbose=True)

        #######################################
        ########### AFFERENT INPUTS ###########
        #######################################

        t_array = ntwk.arange(int(Model['tstop'] / Model['dt'])) * Model['dt']
        faff = smooth(np.array([4 * int(tt / 1000) for tt in t_array]),
                      int(200 / 0.1))

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

        # # # afferent excitation onto cortical excitation and inhibition
        for i, tpop in enumerate(['RecExc', 'RecInh', 'DsInh'
示例#2
0
    plt.show()

else:

    NTWK = ntwk.build_populations(
        Model,
        ['Exc', 'Inh'],
        AFFERENT_POPULATIONS=['AffExc'],
        with_raster=True,
        with_Vm=4,
        # with_synaptic_currents=True,
        # with_synaptic_conductances=True,
        verbose=True)

    ntwk.build_up_recurrent_connections(NTWK,
                                        SEED=5,
                                        verbose=True,
                                        with_ring_geometry=True)

    #######################################
    ########### AFFERENT INPUTS ###########
    #######################################

    t_array = ntwk.arange(int(Model['tstop'] / Model['dt'])) * Model['dt']
    faff = 3. + 0 * t_array
    ntwk.construct_feedforward_input(NTWK, 'Inh', 'AffExc', t_array, faff)
    faff[(t_array > 400) & (t_array > 500)] += 2.
    ntwk.construct_feedforward_input(NTWK, 'Exc', 'AffExc', t_array, faff)

    ################################################################
    ## --------------- Initial Condition ------------------------ ##
    ################################################################