Giter Club home page Giter Club logo

Comments (1)

Silmathoron avatar Silmathoron commented on June 19, 2024

Thinking back on #330 and reading this issue again, I think this could be implemented easily using the apply_spikes proposal by overriding it with:

  • apply_spikes(I_syn_ex, spikes_ex, model="alpha", tau_syn=tau_syn_ex)
  • apply_spikes(I_syn_ex, spikes_ex, model="exp", tau_syn=tau_syn_ex)
  • apply_spikes(spikes_ex, model="delta")

Using this function, the user wouldn't have anything to declare except I_syn_ex in the state block.

EDIT: maybe it would therefore be better to have the spike buffer as 1st parameter, in order to get a function of the form (in the python syntax):

def apply_spikes(spike_buffer, state_variable=None, model=None, tau_syn=None,
                 normalization=None, shape=None):
    '''
    Apply the effect of the spikes on the state variables.
    
    Parameters
    ----------
    buffer : spike_buffer (real)
        Buffer storing the spikes that should be applied.
    state_variable : state variable, optional (default: None)
        State variable on which the spikes should be applied, e.g. `I_syn_ex`
        for a model with post-synaptic currents implementing excitatory
        synapses. If the state variable is computed through a differential
        equation, the user should pass the right time derivative on which
        the effect of the spikes is applied.
    model : str, optional (default: None)
        Name of the predefined model that should be used, among "alpha", "exp",
        and "delta".
    tau_syn : parameter (ms), optional (default: None)
        Synaptic time constant to be used by either the "exp" or "alpha"
        predefined model.
    normalization : float, optional, (default: None)
        Normalization constant to set the peak value of the current or
        conductance. E.g. for an implicitely defined alpha-shape current
        (declared through an ODE), the constant is ``1pA*e/tau_syn_ex``.
    shape : function, optional (default: None)
        Custom shape function which will be used to convolve the spike times.
    
    Notes
    -----
    The optional parameters can be combined in the following ways:
        * `model` alone for "delta"
        * `state_variable` + `model` + `tau_syn` (for "alpha" and "exp")
        * `state_variable` + `shape`
        * `state_variable` alone if no normalization factor is required
        (defaults to 1), e.g. for exponential synapses declared through an ODE.
        * a derivative of the `state_variable` + `normalization` (for synaptic
        state-variables declared through an ODE)
    '''

from nestml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.