Skip to content

Commit

Permalink
Merge branch 'if_curr_delta_ca2_adaptive' into async_neuromorph
Browse files Browse the repository at this point in the history
  • Loading branch information
rowleya committed Jun 6, 2023
2 parents 13f5a4a + 0a5400b commit 656d694
Show file tree
Hide file tree
Showing 7 changed files with 149 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright (c) 2017 The University of Manchester
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

APP = $(notdir $(CURDIR))

NEURON_MODEL_H = $(NEURON_DIR)/neuron/models/neuron_model_lif_impl.h
INPUT_TYPE_H = $(NEURON_DIR)/neuron/input_types/input_type_delta.h
NEURON_IMPL_H = $(NEURON_DIR)/neuron/implementations/neuron_impl_standard.h
THRESHOLD_TYPE_H = $(NEURON_DIR)/neuron/threshold_types/threshold_type_static.h
SYNAPSE_TYPE_H = $(NEURON_DIR)/neuron/synapse_types/synapse_types_delta_impl.h
SYNAPSE_DYNAMICS = $(NEURON_DIR)/neuron/plasticity/synapse_dynamics_static_impl.c
ADDITIONAL_INPUT_H = $(NEURON_DIR)/neuron/additional_inputs/additional_input_ca2_adaptive_impl.h

include ../neural_build.mk
3 changes: 2 additions & 1 deletion neural_modelling/makefiles/neuron/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ MODELS = IF_curr_exp \
IZK_cond_exp \
IF_curr_exp_dual \
IF_curr_delta \
IF_curr_exp_ca2_adaptive
IF_curr_exp_ca2_adaptive \
IF_curr_delta_ca2_adaptive

ifneq ($(SPYNNAKER_DEBUG), DEBUG)
MODELS += external_device_lif_control \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright (c) 2017 The University of Manchester
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

APP = $(notdir $(CURDIR))

NEURON_MODEL_H = $(NEURON_DIR)/neuron/models/neuron_model_lif_impl.h
INPUT_TYPE_H = $(NEURON_DIR)/neuron/input_types/input_type_delta.h
NEURON_IMPL_H = $(NEURON_DIR)/neuron/implementations/neuron_impl_standard.h
THRESHOLD_TYPE_H = $(NEURON_DIR)/neuron/threshold_types/threshold_type_static.h
SYNAPSE_TYPE_H = $(NEURON_DIR)/neuron/synapse_types/synapse_types_delta_impl.h
ADDITIONAL_INPUT_H = $(NEURON_DIR)/neuron/additional_inputs/additional_input_ca2_adaptive_impl.h

include ../neuron_build.mk
1 change: 1 addition & 0 deletions neural_modelling/makefiles/neuron_only/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ MODELS = IF_curr_exp_neuron\
IF_cond_exp_neuron\
IZK_cond_exp_neuron\
IF_curr_exp_ca2_adaptive_neuron\
IF_curr_delta_ca2_adaptive_neuron\
IF_curr_exp_dual_neuron\
IF_curr_exp_sEMD_neuron\
IF_curr_delta_neuron\
Expand Down
4 changes: 3 additions & 1 deletion spynnaker/pyNN/extra_models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
IFCurrExpCa2Adaptive,
IFCurrDualExpBase as IF_curr_dual_exp,
IzkCondExpBase as Izhikevich_cond,
IFCurrExpSEMDBase as IF_curr_exp_sEMD)
IFCurrExpSEMDBase as IF_curr_exp_sEMD,
IFCurrDeltaCa2Adaptive)

# Variable rate poisson
from spynnaker.pyNN.models.spike_source import SpikeSourcePoissonVariable
Expand All @@ -36,6 +37,7 @@
# sPyNNaker models not currently part of full pyNN
'IFCurDelta', 'IFCurrExpCa2Adaptive', 'IFCondExpStoc',
'Izhikevich_cond', 'IF_curr_dual_exp', 'IF_curr_exp_sEMD',
'IFCurrDeltaCa2Adaptive',

# Neuromodulation synapse dynamics (Mantas Mikaitis)
'Neuromodulation',
Expand Down
4 changes: 3 additions & 1 deletion spynnaker/pyNN/models/neuron/builds/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@
from .if_curr_delta import IFCurrDelta
from .if_curr_exp_ca2_adaptive import IFCurrExpCa2Adaptive
from .if_curr_exp_semd_base import IFCurrExpSEMDBase
from .if_curr_delta_ca2_adaptive import IFCurrDeltaCa2Adaptive

__all__ = ["EIFConductanceAlphaPopulation", "HHCondExp", "IFCondAlpha",
"IFCondExpBase", "IFCurrAlpha", "IFCurrDualExpBase",
"IFCurrExpBase", "IFFacetsConductancePopulation", "IzkCondExpBase",
"IzkCurrExpBase", "IFCondExpStoc",
"IFCurrDelta", "IFCurrExpCa2Adaptive", "IFCurrExpSEMDBase"]
"IFCurrDelta", "IFCurrExpCa2Adaptive", "IFCurrExpSEMDBase",
"IFCurrDeltaCa2Adaptive"]
91 changes: 91 additions & 0 deletions spynnaker/pyNN/models/neuron/builds/if_curr_delta_ca2_adaptive.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Copyright (c) 2017 The University of Manchester
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from spynnaker.pyNN.models.neuron import AbstractPyNNNeuronModelStandard
from spynnaker.pyNN.models.defaults import default_initial_values
from spynnaker.pyNN.models.neuron.neuron_models import (
NeuronModelLeakyIntegrateAndFire)
from spynnaker.pyNN.models.neuron.input_types import InputTypeDelta
from spynnaker.pyNN.models.neuron.threshold_types import ThresholdTypeStatic
from spynnaker.pyNN.models.neuron.synapse_types import SynapseTypeDelta
from spynnaker.pyNN.models.neuron.additional_inputs import (
AdditionalInputCa2Adaptive)


class IFCurrDeltaCa2Adaptive(AbstractPyNNNeuronModelStandard):
"""
Leaky integrate and fire neuron with an instantaneous current input.
:param tau_m: :math:`\\tau_m`
:type tau_m: float, iterable(float), ~spynnaker.pyNN.RandomDistribution
or (mapping) function
:param cm: :math:`C_m`
:type cm: float, iterable(float), ~spynnaker.pyNN.RandomDistribution
or (mapping) function
:param v_rest: :math:`V_{rest}`
:type v_rest: float, iterable(float), ~spynnaker.pyNN.RandomDistribution
or (mapping) function
:param v_reset: :math:`V_{reset}`
:type v_reset: float, iterable(float), ~spynnaker.pyNN.RandomDistribution
or (mapping) function
:param v_thresh: :math:`V_{thresh}`
:type v_thresh: float, iterable(float), ~spynnaker.pyNN.RandomDistribution
or (mapping) function
:param tau_refrac: :math:`\\tau_{refrac}`
:type tau_refrac: float, iterable(float),
~spynnaker.pyNN.RandomDistribution or (mapping) function
:param tau_ca2: :math:`\\tau_{\\mathrm{Ca}^{+2}}`
:type tau_ca2: float, iterable(float), ~spynnaker.pyNN.RandomDistribution
or (mapping) function
:param i_ca2: :math:`I_{\\mathrm{Ca}^{+2}}`
:type i_ca2: float, iterable(float), ~spynnaker.pyNN.RandomDistribution
or (mapping) function
:param i_alpha: :math:`\\tau_\\alpha`
:type i_alpha: float, iterable(float), ~spynnaker.pyNN.RandomDistribution
or (mapping) function
:param i_offset: :math:`I_{offset}`
:type i_offset: float, iterable(float), ~spynnaker.pyNN.RandomDistribution
or (mapping) function
:param v: :math:`V_{init}`
:type v: float, iterable(float), ~spynnaker.pyNN.RandomDistribution
or (mapping) function
:param isyn_exc: :math:`I^{syn}_e`
:type isyn_exc: float, iterable(float), ~spynnaker.pyNN.RandomDistribution
or (mapping) function
:param isyn_inh: :math:`I^{syn}_i`
:type: isyn_inh: float, iterable(float), ~spynnaker.pyNN.RandomDistribution
or (mapping) function
"""

# noinspection PyPep8Naming
@default_initial_values({"v", "isyn_exc", "isyn_inh"})
def __init__(
self, tau_m=20.0, cm=1.0, v_rest=-65.0, v_reset=-65.0,
v_thresh=-50.0, tau_refrac=0.1, tau_ca2=50.0, i_ca2=0.0,
i_alpha=0.1, i_offset=0.0, v=-65.0, isyn_exc=0.0, isyn_inh=0.0):
# pylint: disable=too-many-arguments
neuron_model = NeuronModelLeakyIntegrateAndFire(
v, v_rest, tau_m, cm, i_offset, v_reset, tau_refrac)
synapse_type = SynapseTypeDelta(isyn_exc, isyn_inh)
input_type = InputTypeDelta()
threshold_type = ThresholdTypeStatic(v_thresh)
additional_input_type = AdditionalInputCa2Adaptive(
tau_ca2, i_ca2, i_alpha)

super().__init__(
model_name="IF_curr_delta_ca2_adaptive",
binary="IF_curr_delta_ca2_adaptive.aplx",
neuron_model=neuron_model, input_type=input_type,
synapse_type=synapse_type, threshold_type=threshold_type,
additional_input_type=additional_input_type)

0 comments on commit 656d694

Please sign in to comment.