wSV, wVS, wPP, wEP = -0.6, -0.5, -0.1, -40.0
elif Panel==3: # e
    VE, VP, MP = 0, 1, 1
    wSV, wVS, wPP, wEP = -0.6, -0.5, -1.5, -40.0
elif Panel==4: # f
    VE, VP, MP = 0, 0, 1
    wSV, wVS, wPP, wEP = -0.6, -0.5, -1.5, -40.0

wPV = -(VP + abs(wSV)*MP - (1-wPP)/(-0.07*wEP) * VE) # gain = 0.07
wPS = -(abs(wVS)*abs(wPV) + (1-wSV*wVS)*MP) 

NeuPar = Neurons()
NetPar = Network(NeuPar, wPP=wPP, wPS=wPS, wPV=wPV, wEP=wEP, flag_hetero=0)

### Define input parameters
stim_max, SD = 50.0, 10.0
r0 = np.array([1,2,2,4])

StimPar = Stimulation(NeuPar, NetPar, SD, None, stim_max, r0 = r0, VE=VE, VP=VP, MP=MP, VS=VS, VV=VV)

### Define simulation parameters
SimPar = Simulation()

### Run simulation
RunStaticNetwork(NeuPar, NetPar, StimPar, SimPar, folder, fln)
SaveNetworkPara(NeuPar, NetPar, StimPar, None, folder, fln)

### Analyse & plot network
Bar_pathways(NeuPar, NetPar, VE, VP, MP, folder, fln, pPE_flag = True)
Plot_PopulationRate(NeuPar, folder, fln)
### Define plasticity parameter
LearnPar = Learning(NeuPar)

#####################
# Before plasticity #
#####################

### Define input parameters
stim_max, SD = dtype(100), dtype(5)
Xternal = dtype([400, 2, 2, 2, 40])
num_stim = np.int32(10)

StimPar_test = Stimulation(NeuPar,
                           NetPar,
                           SD,
                           None,
                           stim_max,
                           Xternal=Xternal,
                           VE_scale=VE_scale)
StimPar_test_long = Stimulation(NeuPar,
                                NetPar,
                                SD,
                                num_stim,
                                stim_max,
                                flg_test=0,
                                Xternal=Xternal,
                                VE_scale=VE_scale)

### Run simulations
RunStaticNetwork(NeuPar, NetPar, StimPar_test_long, SimPar_test, folder,
                 'Before_Balance')
# #####################
# ##### Learning ######
# #####################

### Define input parameters
stim_max, SD = dtype(100), dtype(5)
Xternal = dtype([400, 2, 2, 2, 0])
if FlagDendRec == 0:
    Xternal[-1] = 40
num_stim = np.int32(3600)

StimPar = Stimulation(NeuPar,
                      NetPar,
                      SD,
                      num_stim=num_stim,
                      stim_max=stim_max,
                      flg_test=0,
                      Xternal=Xternal,
                      CT=True)

### Run simulation
RunPlasticNetwork(NeuPar, NetPar, StimPar, SimPar, LearnPar, SavePar, folder,
                  FlagDendRec_ABC[FlagDendRec])
SaveNetworkPara(NeuPar, NetPar, StimPar, LearnPar, folder,
                FlagDendRec_ABC[FlagDendRec] + 'After')

#####################
# After plasticity ##
#####################

### Define input parameters
Ejemplo n.º 4
0
### Define plasticity parameter
LearnPar = Learning(NeuPar)


# #####################
# ##### Learning ######
# #####################

### Define input parameters
stim_max, SD = dtype(100), dtype(5)
Xternal = dtype([400,2,2,2,0])
num_stim = np.int32(3600)
VS = num_SOMs_visual/100
VV = np.round(1 - VS,1)

StimPar = Stimulation(NeuPar, NetPar, SD, num_stim=num_stim, stim_max=stim_max, 
                      VS=VS, VV=VV, flg_test=0, Xternal=Xternal)

### Run simulation
fln = 'After_' + str(num_SOMs_visual)
RunPlasticNetwork(NeuPar, NetPar, StimPar, SimPar, LearnPar, SavePar, folder, fln)
SaveNetworkPara(NeuPar, NetPar, StimPar, LearnPar, folder, fln)


#####################
# After plasticity ##
#####################

### Define input parameters
StimPar_test = Stimulation(NeuPar, NetPar, SD, None, stim_max, Xternal=Xternal, MM_factor = dtype(0.5))
StimPar_test.neurons_visual = StimPar.neurons_visual
StimPar_test.neurons_motor = StimPar.neurons_motor
### Define plasticity parameter
LearnPar = Learning(NeuPar)


#####################
# Before plasticity #
#####################

### Define input parameters
stim_max, SD = dtype(100), dtype(5)
Xternal = dtype([400,2,2,2,0])
num_stim = np.int32(10)
VS, VV, VP, MP = np.int32(0), np.int32(1), np.int32(0), np.int32(1)

StimPar_test = Stimulation(NeuPar, NetPar, SD, None, stim_max, VS=VS, VV=VV, VP=VP, MP=MP,
                           Xternal=Xternal, pPE_flag = True, MM_factor = dtype(0.5))
StimPar_test_long = Stimulation(NeuPar, NetPar, SD, num_stim, stim_max, VS=VS, VV=VV, VP=VP, MP=MP,
                                flg_test=0, Xternal=Xternal, pPE_flag = True)

### Run simulations
RunStaticNetwork(NeuPar, NetPar, StimPar_test_long, SimPar_test, folder, 'Before_Balance')
RunStaticNetwork(NeuPar, NetPar, StimPar_test, SimPar_test, folder, 'Before_Test')
SaveNetworkPara(NeuPar, NetPar, StimPar_test_long, None, folder,'Before')

### Analyse & plot network
Plot_Currents2PC(NeuPar, NetPar, StimPar_test_long, SimPar_test, folder, 'Before_Balance')
HeatmapTest(NeuPar, NeuPar.NCells[0], folder, 'Before_Test', MM_factor=dtype(0.5))


# #####################
# ##### Learning ######
LearnPar = Learning(NeuPar, pPV=dtype(0))

# #####################
# ##### Learning ######
# #####################

### Define input parameters
stim_max, SD = dtype(100), dtype(5)
Xternal = dtype([400, 2, 2, 2, 0])
num_stim = np.int32(3600)

StimPar = Stimulation(NeuPar,
                      NetPar,
                      SD,
                      num_stim=num_stim,
                      stim_max=stim_max,
                      flg_test=0,
                      Xternal=Xternal,
                      VP=int(PV_input_type),
                      MP=int(1 - PV_input_type))

### Run simulation
RunPlasticNetwork(NeuPar, NetPar, StimPar, SimPar, LearnPar, SavePar, folder,
                  PV_input_ABC[PV_input_type])
SaveNetworkPara(NeuPar, NetPar, StimPar, LearnPar, folder,
                PV_input_ABC[PV_input_type] + '_After')

#####################
# After plasticity ##
#####################
Ejemplo n.º 7
0
SimPar = Simulation(dt=0.2)
SavePar = SaveData()

### Define plasticity parameter
LearnPar = Learning(NeuPar)

# #####################
# # Before plasticity #
# #####################

# ### Define input parameters
stim_max, SD = dtype(100), dtype(5)
Xternal = dtype([400, 2, 2, 2, 0])
num_stim = np.int32(10)

StimPar_test = Stimulation(NeuPar, NetPar, SD, None, stim_max, Xternal=Xternal)
StimPar_test_long = Stimulation(NeuPar,
                                NetPar,
                                SD,
                                num_stim,
                                stim_max,
                                flg_test=0,
                                Xternal=Xternal)

### Run simulations
RunStaticNetwork(NeuPar, NetPar, StimPar_test_long, SimPar_test, folder,
                 'Before_Balance')
RunStaticNetwork(NeuPar, NetPar, StimPar_test, SimPar_test, folder,
                 'Before_Test')
SaveNetworkPara(NeuPar, NetPar, StimPar_test_long, None, folder, 'Before')