Esempio n. 1
0
class Synapses(Enum):

    GLUTAMATERGIC = SynapseModel(
        'Glutamatergic',
        nest_model=SynapseModels.STATIC_SYNAPSE.value,
        params={'delay': Constants.SYNAPTIC_DELAY_EX.value})

    GABAERGIC = SynapseModel(
        'GABAergic',
        nest_model=SynapseModels.STATIC_SYNAPSE.value,
        params={'delay': Constants.SYNAPTIC_DELAY_EX.value})
Esempio n. 2
0
class MotorCortexColumns(AbstractColumns):
    """
	Implementation of the AbstractColumns class with overrided methods
	"""
    _logger = api_kernel.log.getLogger("MotorCortexColumns")
    _glu_syn_params = {
        'delay': [1, 2.5],  # Synaptic delay
        'alpha': 1.0,  # Coeficient for inhibitory STDP time (alpha * lambda)
        'lambda': 0.01,  # Time interval for STDP
        'Wmax': 10,  # Maximum possible weight
        'mu_minus': 0.01,  # STDP depression step
        'mu_plus': 0.01  # STDP potential step
    }
    _Glutamatergic = SynapseModel("Glutamatergic_columns",
                                  nest_model=STDP_SYNAPSE,
                                  params=_glu_syn_params)

    def __init__(self, width, height):
        """
		Args:
			width (int): size (width) of the column structure
			height (int): size (height) of the column structure
		"""
        self._columns = {}
        self._width_x = width
        self._height_y = height
        self._column_mapping = np.arange(height * width).reshape(
            (height, width))
        # Create cortex columns (by layers)
        for column in range(width * height):
            self._logger.info("column {} of {}".format(column + 1,
                                                       width * height))
            self._columns[column] = MotorCortexLayers(column)
        # Connect columns
        self._setConnectomes()

    def _setConnectomes(self):
        # Setup synapse model
        for column_index in self.getColumnsIndexes():
            for neighbor_index in self._getColumnNeighbors(column_index):
                self.columns(column_index).layers(L2).nuclei(Glu).connect(
                    self.columns(neighbor_index).layers(L2).nuclei(Glu),
                    synapse=self._Glutamatergic,
                    weight=0.5,
                    conn_prob=0.093)
Esempio n. 3
0
class MotorCortexLayers(AbstractLayers):
    """
	Class implementation of the  Motor cortex layers class
	"""
    # Common variable for objects
    _nrn_parameters = {
        't_ref': [2.5, 4.0],  # Refractory period
        'V_m': -70.0,  #
        'E_L': -70.0,  #
        'E_K': -77.0,  #
        'g_L': 30.0,  #
        'g_Na': 12000.0,  #
        'g_K': 3600.0,  #
        'C_m': 134.0,  # Capacity of membrane (pF)
        'tau_syn_ex': 0.2,  # Time of excitatory action (ms)
        'tau_syn_in': 2.0  # Time of inhibitory action (ms)
    }

    _glu_syn_params = {
        'delay': [1, 2.5],  # Synaptic delay
        'alpha': 1.0,  # Coeficient for inhibitory STDP time (alpha * lambda)
        'lambda': 0.01,  # Time interval for STDP
        'Wmax': 10,  # Maximum possible weight
        'mu_minus': 0.01,  # STDP depression step
        'mu_plus': 0.01  # STDP potential step
    }

    _gaba_syn_params = {
        'delay': [1, 2.5],  # Synaptic delay
        'alpha': 1.0,  # Coeficient for inhibitory STDP time (alpha * lambda)
        'lambda': 0.01,  # Time interval for STDP
        'Wmax': -10.0,  # Maximum possible weight
        'mu_minus': 0.01,  # STDP depression step
        'mu_plus': 0.01  # STDP potential step
    }

    # Setup synapse models
    _Glutamatergic = SynapseModel("Glutamatergic_layers",
                                  nest_model=STDP_SYNAPSE,
                                  params=_glu_syn_params)
    _GABAergic = SynapseModel("GABAergic_layers",
                              nest_model=STDP_SYNAPSE,
                              params=_gaba_syn_params)

    def __init__(self, column_index):
        # Create Nucleus objects and put into the dict of the layers
        self._dict_layers = {
            L2: Nucleus("Column {} Layer 2".format(column_index)),
            L3: Nucleus("Column {} Layer 3".format(column_index)),
            L4: Nucleus("Column {} Layer 4".format(column_index)),
            L5A: Nucleus("Column {} Layer 5A".format(column_index)),
            L5B: Nucleus("Column {} Layer 5B".format(column_index)),
            L6: Nucleus("Column {} Layer 6".format(column_index))
        }
        # Add sub-nucleui and create neurons without sqaling (because of flag 'forColumns'=True)
        self.layers(L2).addSubNucleus(Glu,
                                      number=546,
                                      params=self._nrn_parameters,
                                      forColumns=True)
        self.layers(L2).addSubNucleus(GABA,
                                      number=107,
                                      params=self._nrn_parameters,
                                      forColumns=True)
        self.layers(L3).addSubNucleus(Glu,
                                      number=1145,
                                      params=self._nrn_parameters,
                                      forColumns=True)
        self.layers(L3).addSubNucleus(GABA,
                                      number=123,
                                      params=self._nrn_parameters,
                                      forColumns=True)
        self.layers(L4).addSubNucleus(Glu,
                                      number=1656,
                                      params=self._nrn_parameters,
                                      forColumns=True)
        self.layers(L4).addSubNucleus(GABA,
                                      number=140,
                                      params=self._nrn_parameters,
                                      forColumns=True)
        self.layers(L5A).addSubNucleus(Glu,
                                       number=454,
                                       params=self._nrn_parameters,
                                       forColumns=True)
        self.layers(L5A).addSubNucleus(GABA,
                                       number=90,
                                       params=self._nrn_parameters,
                                       forColumns=True)
        self.layers(L5B).addSubNucleus(Glu,
                                       number=641,
                                       params=self._nrn_parameters,
                                       forColumns=True)
        self.layers(L5B).addSubNucleus(GABA,
                                       number=131,
                                       params=self._nrn_parameters,
                                       forColumns=True)
        self.layers(L6).addSubNucleus(Glu,
                                      number=1288,
                                      params=self._nrn_parameters,
                                      forColumns=True)
        self.layers(L6).addSubNucleus(GABA,
                                      number=127,
                                      params=self._nrn_parameters,
                                      forColumns=True)
        # Invoke method to create synapses
        self.setConnectomes()

    def setConnectomes(self):
        """
		Set connectomes between layers
		"""
        # Connection probability
        L2_to_L2 = 0.093
        L2_to_L5A = 0.043

        L3_to_L2 = 0.055
        L3_to_L3 = 0.187
        L3_to_L5B = 0.018

        L4_to_L2 = 0.009
        L4_to_L3 = 0.024
        L4_to_L4 = 0.243
        L4_to_L5A = 0.007
        L4_to_L5B = 0.007

        L5A_to_L3 = 0.057
        L5A_to_L5A = 0.191

        L5B_to_L2 = 0.083
        L5B_to_L5B = 0.072
        L5B_to_L6 = 0.020

        L6_to_L4 = 0.032
        L6_to_L5A = 0.032
        L6_to_L6 = 0.028

        # Setup connectomes
        self.layers(L2).nuclei(Glu).connect(self.layers(L2).nuclei(GABA),
                                            synapse=self._Glutamatergic,
                                            weight=0.7)  #, conn_prob=L2_to_L2)
        self.layers(L2).nuclei(Glu).connect(
            self.layers(L5A).nuclei(Glu),
            synapse=self._Glutamatergic,
            weight=1.0)  #, conn_prob=L2_to_L5A)
        self.layers(L2).nuclei(GABA).connect(self.layers(L2).nuclei(Glu),
                                             synapse=self._GABAergic,
                                             weight=-1.5)

        self.layers(L3).nuclei(Glu).connect(self.layers(L2).nuclei(Glu),
                                            synapse=self._Glutamatergic,
                                            weight=1.0)  #, conn_prob=L3_to_L2)
        self.layers(L3).nuclei(Glu).connect(self.layers(L3).nuclei(GABA),
                                            synapse=self._Glutamatergic,
                                            weight=0.5)  #, conn_prob=L3_to_L3)
        self.layers(L3).nuclei(Glu).connect(
            self.layers(L5B).nuclei(Glu),
            synapse=self._Glutamatergic,
            weight=1.0)  #, conn_prob=L3_to_L5B)
        self.layers(L3).nuclei(GABA).connect(self.layers(L3).nuclei(Glu),
                                             synapse=self._GABAergic,
                                             weight=-1.5)

        self.layers(L4).nuclei(Glu).connect(self.layers(L2).nuclei(Glu),
                                            synapse=self._Glutamatergic,
                                            weight=0.6)  #, conn_prob=L4_to_L2)
        self.layers(L4).nuclei(Glu).connect(self.layers(L3).nuclei(Glu),
                                            synapse=self._Glutamatergic,
                                            weight=0.6)  #, conn_prob=L4_to_L3)
        self.layers(L4).nuclei(Glu).connect(self.layers(L4).nuclei(Glu),
                                            synapse=self._Glutamatergic,
                                            weight=0.7)  #, conn_prob=L4_to_L4)
        self.layers(L4).nuclei(Glu).connect(self.layers(L4).nuclei(GABA),
                                            synapse=self._Glutamatergic,
                                            weight=0.5)  #, conn_prob=L4_to_L4)
        self.layers(L4).nuclei(Glu).connect(
            self.layers(L5A).nuclei(Glu),
            synapse=self._Glutamatergic,
            weight=0.6)  #, conn_prob=L4_to_L5A)
        self.layers(L4).nuclei(Glu).connect(
            self.layers(L5B).nuclei(Glu),
            synapse=self._Glutamatergic,
            weight=0.6)  #, conn_prob=L4_to_L5B)
        self.layers(L4).nuclei(GABA).connect(self.layers(L4).nuclei(Glu),
                                             synapse=self._GABAergic,
                                             weight=-1.5)

        self.layers(L5A).nuclei(Glu).connect(
            self.layers(L3).nuclei(Glu),
            synapse=self._Glutamatergic,
            weight=1.0)  #, conn_prob=L5A_to_L3)
        self.layers(L5A).nuclei(Glu).connect(
            self.layers(L5A).nuclei(Glu),
            synapse=self._Glutamatergic,
            weight=0.7)  #, conn_prob=L5A_to_L5A)
        self.layers(L5A).nuclei(Glu).connect(
            self.layers(L5A).nuclei(GABA),
            synapse=self._Glutamatergic,
            weight=0.5)  #, conn_prob=L5A_to_L5A)
        self.layers(L5A).nuclei(GABA).connect(self.layers(L5A).nuclei(Glu),
                                              synapse=self._GABAergic,
                                              weight=-1.5)

        self.layers(L5B).nuclei(Glu).connect(
            self.layers(L2).nuclei(Glu),
            synapse=self._Glutamatergic,
            weight=1.0)  #, conn_prob=L5B_to_L2)
        self.layers(L5B).nuclei(Glu).connect(
            self.layers(L5B).nuclei(GABA),
            synapse=self._Glutamatergic,
            weight=0.5)  #, conn_prob=L5B_to_L5B)
        self.layers(L5B).nuclei(Glu).connect(
            self.layers(L6).nuclei(Glu),
            synapse=self._Glutamatergic,
            weight=1.0)  #, conn_prob=L5B_to_L6)
        self.layers(L5B).nuclei(GABA).connect(self.layers(L5B).nuclei(Glu),
                                              synapse=self._GABAergic,
                                              weight=-1.5)

        self.layers(L6).nuclei(Glu).connect(self.layers(L4).nuclei(Glu),
                                            synapse=self._Glutamatergic,
                                            weight=0.7)  #, conn_prob=L6_to_L4)
        self.layers(L6).nuclei(Glu).connect(
            self.layers(L5A).nuclei(Glu),
            synapse=self._Glutamatergic,
            weight=1.0)  #, conn_prob=L6_to_L5A)
        self.layers(L6).nuclei(Glu).connect(self.layers(L6).nuclei(GABA),
                                            synapse=self._Glutamatergic,
                                            weight=0.5)  #, conn_prob=L6_to_L6)
        self.layers(L6).nuclei(GABA).connect(self.layers(L4).nuclei(Glu),
                                             synapse=self._GABAergic,
                                             weight=-1.5)
        self.layers(L6).nuclei(GABA).connect(self.layers(L6).nuclei(Glu),
                                             synapse=self._GABAergic,
                                             weight=-1.5)
Esempio n. 4
0
from neucogar.namespaces import *
from neucogar.api_kernel import CreateNetwork
from neucogar.SynapseModel import SynapseModel

from brain_parts import *

# Init synapses
Glutamatergic = SynapseModel("Glutamatergic", nest_model=STDP_SYNAPSE, params=stdp_glu_params)
GABAergic = SynapseModel("GABAergic", nest_model=STDP_SYNAPSE, params=stdp_gaba_params)
Dopaminergic_ex = SynapseModel("Dopaminergic_ex", nest_model=STDP_DOPA_SYNAPSE, params=stdp_dopa_ex_params)
Dopaminergic_in = SynapseModel("Dopaminergic_in", nest_model=STDP_DOPA_SYNAPSE, params=stdp_dopa_in_params)


# Set connectomes
motor_cortex.nuclei(Glu_0).connect(striatum.nuclei(GABA_D1), synapse=Glutamatergic, weight=0.1)
motor_cortex.nuclei(Glu_0).connect(striatum.nuclei(GABA_D2), synapse=Glutamatergic, weight=0.1)
motor_cortex.nuclei(Glu_0).connect(striatum.nuclei(GABA_D2), synapse=Glutamatergic, weight=0.08)
motor_cortex.nuclei(Glu_0).connect(stn.nuclei(Glu), synapse=Glutamatergic, weight=1)
motor_cortex.nuclei(Glu_0).connect(thalamus.nuclei(Glu), synapse=Glutamatergic, weight=0.08)

thalamus.nuclei(Glu).connect(motor_cortex.nuclei(Glu_1), synapse=Glutamatergic, weight=1)

striatum.nuclei(GABA_D1).connect(snr.nuclei(GABA), synapse=GABAergic, weight=-0.01)
striatum.nuclei(GABA_D1).connect(gpi.nuclei(GABA), synapse=GABAergic, weight=-0.01)
striatum.nuclei(GABA_D2).connect(gpe.nuclei(GABA), synapse=GABAergic, weight=-0.01)

gpe.nuclei(GABA).connect(stn.nuclei(Glu), synapse=GABAergic, weight=-0.01)

stn.nuclei(Glu).connect(snr.nuclei(GABA), synapse=Glutamatergic, weight=1)
stn.nuclei(Glu).connect(gpi.nuclei(GABA), synapse=Glutamatergic, weight=1)
stn.nuclei(Glu).connect(gpe.nuclei(GABA), synapse=Glutamatergic, weight=0.3)
Esempio n. 5
0
from neucogar.namespaces import *
from neucogar.api_kernel import CreateNetwork
from neucogar.SynapseModel import SynapseModel

from .brain_parts import *
from dopamine.connectomes import *

# Init synapses
Serotoninergic_ex = SynapseModel("Serotoninergic_ex",
                                 nest_model=STDP_SERO_SYNAPSE,
                                 params=stdp_sero_ex_params)
Serotoninergic_in = SynapseModel("Serotoninergic_in",
                                 nest_model=STDP_SERO_SYNAPSE,
                                 params=stdp_sero_in_params)

# Glu 0 - VA/VL
# GLu1 - midline nuclei

#pfc.nuclei(Glu).connect(drn.nuclei(HT5), synapse=Glutamatergic, weight=10)
#pfc.nuclei(GABA).connect(pfc.nuclei(Glu), synapse=GABAergic, weight=-10)

###thalamus.nuclei(Glu_1).connect(pfc.columns(0).layers(L4).nuclei(Glu), synapse=Glutamatergic, weight=5)

#vta.nuclei(DA).connect(pfc.columns(0).layers(L4).nuclei(Glu), synapse=Dopaminergic_ex, weight=5)

#vta.nuclei(DA).connect(drn.nuclei(HT5), synapse=Dopaminergic_ex, weight=10)
#snc.nuclei(DA).connect(drn.nuclei(HT5), synapse=Dopaminergic_ex, weight=10)

# !!! locus_coeruleus.nuclei(NA).connect(drn.nuclei(HT5), synapse=NA , weight=1)

locus_coeruleus.nuclei(NA).connect(vta.nuclei(DA), synapse=NA_ex,
Esempio n. 6
0
    'Wmax': 300,  # Maximum possible weight
    'mu_minus': 0.005,  # STDP depression step
    'mu_plus': 0.005  # STDP potential step
}
stdp_gaba = {
    'delay': 1.25,  # Synaptic delay
    'alpha': 1.0,  # Coeficient for inhibitory STDP time (alpha * lambda)
    'lambda': 0.0075,  # Time interval for STDP
    'Wmax': -300.0,  # Maximum possible weight
    'mu_minus': 0.005,  # STDP depression step
    'mu_plus': 0.005  # STDP potential step
}

# synapses
Glutamatergic = SynapseModel("Glutamatergic",
                             nest_model=NEST_NAMESPACE.STDP_SYNAPSE,
                             params=stdp_glu)
GABAergic = SynapseModel("GABAergic",
                         nest_model=NEST_NAMESPACE.STDP_SYNAPSE,
                         params=stdp_gaba)

weight_Glu = 185
weight_GABA = -70


def connect(neuron_network):
    # source is FLEX_MOTOR
    neuron_network.connect(source=Layer1NeuronGroupNames.FLEX_MOTOR,
                           target=Layer1NeuronGroupNames.FLEX_RENSHAW,
                           synapse=Glutamatergic,
                           weight=weight_Glu)