skneuromsi.neural._cuppini2017 module

class skneuromsi.neural._cuppini2017.Cuppini2017Integrator(tau: tuple, s: float, theta: float, name: str = 'Cuppini2017Integrator')[source]

Bases: object

Integrator for the Cuppini2017 model.

This class represents the integrator function used to compute the dynamics of the neural network according to the Cuppini (2017) model. It handles the update rules for the neurons’ activities based on their net inputs.

tau: tuple

Time constants for the auditory, visual, and multisensory neurons.

s: float

Slope of the sigmoid activation function.

theta: float

Central position of the sigmoid activation function.

name: str = 'Cuppini2017Integrator'

Name of the integrator

sigmoid(u)[source]

Computes the sigmoid activation function.

class skneuromsi.neural._cuppini2017.Cuppini2017(*, neurons=180, tau=(3, 15, 1), s=0.3, theta=20, seed=None, mode0='auditory', mode1='visual', position_range=(0, 180), position_res=1, time_range=(0, 100), time_res=0.01, **integrator_kws)[source]

Bases: SKNMSIMethodABC

Network model for causal inference of Cuppini et al. (2017).

This model simulates neural responses in a multisensory system, consisting of auditory, visual, and multisensory layers. The model consists of three layers: two encode auditory and visual stimuli separately, and connect to a multisensory layer where causal inference is computed. By default, each of these layers consists of 180 neurons arranged topologically to encode a 180° space. In this way, each neuron encodes 1° of space and neurons close to each other encode close spatial positions.

References

[Cuppini et al., 2017]

Notes

Each neuron is indicated with a superscript \(c\) for a specific cortical area (\(a\) for auditory, \(v\) for visual, \(m\) for multisensory). Each neuron also has a subscript \(j\) referring to its spatial position within a given area.

The neurons use a sigmoid activation function and first-order dynamics:

\[\tau^{c} \frac{dy^{c}_{j}(t)}{dt} = - y^{c}_{j}(t) + F(u^{c}_{j}(t)), \ c = a, v, m\]

where:

  • \(u(t)\) and \(y(t)\) are the net input and output of a neuron at time \((t)\).

  • \(\tau^{c}\) is the time constant of neurons in area \(c\).

  • \(F(u)\) is the sigmoid function:

\[F(u_{j}^{c}) = \frac{1}{1 + \exp^{-s (u_{j}^{c} - \theta)}}\]

Here, \(s\) and \(\theta\) denote the slope and the central position of the sigmoid function, respectively.

Neurons in all regions differ only in their time constants, with faster sensory processing for auditory stimuli compared to visual stimuli.

Neurons are connected in a “Mexican hat” pattern within each layer, defined by:

\[\begin{split}L_{jk}^{s} = \left\{ \begin{matrix} L_{ex}^{c} \cdot \exp\left(- \frac{(D_{jk})^{2}} {2 \cdot (\sigma_{ex}^{c})^{2}}\right) - L_{in}^{c} \cdot \exp\left(- \frac{(D_{jk})^{2}}{2 \cdot (\sigma_{in}^{c})^{2}}\right), & D_{jk} \neq 0 \\ 0, \ D_{jk} = 0 \end{matrix} \right.\end{split}\]

where:

  • \(L_{jk}^{c}\) is the synaptic weight from the pre-synaptic neuron at position \(k\) to the post-synaptic neuron at position \(j\).

  • \(D_{jk}\) is the distance between pre-synaptic and post-synaptic neurons:

\[\begin{split}D_{jk} = \left\{ \begin{matrix} | j-k |, & | j-k | \leqslant N/2 \\ N - | j-k |, & | j-k | > N/2 \end{matrix} \right.\end{split}\]

Neurons in the unisensory layers are reciprocally connected with neurons in the opposite layer (e.g., auditory to visual). These connections are defined by:

\[W^{cd}_{jk} = W^{cd}_{0} \cdot \exp\left(- \frac{(D_{jk})^{2}}{2 (\sigma^{cd})^{2}}\right), \ cd = av\text{ or } va\]

where:

  • \(W_{0}^{cd}\) is the maximum synaptic efficacy.

  • \(D_{jk}\) is the distance between neurons in different sensory regions.

  • \(\sigma^{cd}\) is the width of the cross-modal synapses.

Neurons in unisensory layers also have excitatory connections to the multisensory layer:

\[W^{mc}_{jk} = W^{mc}_{0} \cdot \exp\left(- \frac{(D_{jk})^{2}}{2 (\sigma^{mc})^{2}}\right), \ c = a,v\]

where:

  • \(W^{mc}_{0}\) is the highest value of synaptic efficacy.

  • \(D_{jk}\) is the distance between neurons in multisensory and unisensory areas.

  • \(\sigma^{mc}\) is the width of the feedforward synapses.

The visual and auditory stimuli are modeled as Gaussian functions:

\[e^{c}_{j}(t) = E^{c}_{0} \cdot \exp\left(- \frac{(d^{c}_{j})^{2}}{2 (\sigma^{c})^{2}}\right)\]

where:

  • \(E^{c}_{0}\) is the stimulus strength.

  • \(d^{c}_{j}\) is the distance between the neuron and the stimulus.

  • \(\sigma^{c}\) is the degree of uncertainty in detection.

The net input to a neuron combines within-region and extra-area components:

\[u^{c}_{j}(t) = l^{c}_{j}(t) + o^{c}_{j}(t)\]

where \(l^{c}_{j}(t)\) is the within-region input:

\[l^{c}_{j}(t) = \sum_{k} L^{c}_{jk} \cdot y^{c}_{jk}(t)\]

Here \(o^{c}_{j}(t)\) is the extra-area input, including external stimuli, cross-modal input, and noise.

property neurons

Number of neurons in each layer.

Returns:

The number of neurons used in the simulation.

Return type:

int

property tau

Time constants for the neurons.

Returns:

Time constants for the auditory, visual, and multisensory neurons, respectively.

Return type:

tuple of 3 float

property s

Slope of the sigmoid activation function.

Returns:

The slope parameter of the sigmoid function used in the model.

Return type:

float

property theta

Central position of the sigmoid activation function.

Returns:

The central position parameter of the sigmoid function used in the model.

Return type:

float

property random

Random number generator.

Returns:

The random number generator used for initialization.

Return type:

numpy.random.Generator

property time_range

Time range for simulation.

Returns:

The start and end times for the simulation in seconds.

Return type:

tuple of 2 float

property time_res

Time resolution of the simulation.

Returns:

The time step size for the simulation in seconds.

Return type:

float

property position_range

Range of positions in degrees.

Returns:

The minimum and maximum positions in degrees.

Return type:

tuple of 2 int

property position_res

Resolution of position encoding.

Returns:

The resolution of position encoding in degrees.

Return type:

float

property mode0

Returns the name of the first sensory modality.

Returns:

The name of the first sensory modality.

Return type:

str

property mode1

Returns the name of the second sensory modality.

Returns:

The name of the second sensory modality.

Return type:

str

set_random(rng)[source]

Set the random number generator for the model.

This method allows for setting a custom random number generator, which can be useful for ensuring reproducibility or for using different random number generation strategies.

Parameters:
  • rng (numpy.random.Generator)

  • used. (The random number generator to be)

  • numpy.random.Generator. (It should be an instance of)

run(*, auditory_position=None, visual_position=None, auditory_sigma=32, visual_sigma=4, auditory_intensity=28, visual_intensity=27, auditory_duration=None, auditory_onset=0, auditory_stim_n=1, visual_duration=None, visual_onset=0, visual_stim_n=1, auditory_soa=None, visual_soa=None, noise=False, noise_level=0.4, feedforward_weight=18, cross_modal_weight=1.4, causes_kind='count', causes_dim='space', causes_peak_threshold=0.15, causes_peak_distance=None)[source]

Run the simulation of the Cuppini2017 model.

It computes the activity of auditory, visual, and multisensory neurons based on the provided inputs and parameters. The simulation includes the generation of stimuli, calculation of lateral and cross-modal synaptic inputs, and the integration of the model’s dynamics.

Parameters:
  • auditory_position (int, optional) – The spatial position of the auditory stimulus. Defaults to the center of the position range if not provided.

  • visual_position (int, optional) – The spatial position of the visual stimulus. Defaults to the center of the position range if not provided.

  • auditory_sigma (float, optional) – The standard deviation of the Gaussian function used to represent the auditory stimulus. Default is 32.

  • visual_sigma (float, optional) – The standard deviation of the Gaussian function used to represent the visual stimulus. Default is 4.

  • auditory_intensity (float, optional) – The intensity of the auditory stimulus. Default is 28.

  • visual_intensity (float, optional) – The intensity of the visual stimulus. Default is 27.

  • auditory_duration (float, optional) – The duration of the auditory stimulus. Defaults to the full time range if not provided.

  • auditory_onset (float, optional) – The onset time of the auditory stimulus. Default is 0.

  • auditory_stim_n (int, optional) – The number of auditory stimuli to generate. Default is 1.

  • visual_duration (float, optional) – The duration of the visual stimulus. Defaults to the full time range if not provided.

  • visual_onset (float, optional) – The onset time of the visual stimulus. Default is 0.

  • visual_stim_n (int, optional) – The number of visual stimuli to generate. Default is 1.

  • auditory_soa (float, optional) – Stimulus-onset asynchrony for auditory stimuli (default is None).

  • visual_soa (float, optional) – Stimulus-onset asynchrony for visual stimuli (default is None).

  • noise (bool, optional) – Whether to include noise in the simulation. Default is False.

  • noise_level (float, optional) – Level of noise to add (default is 0.40).

  • feedforward_weight (float, optional) – The weight of the feedforward synapses from the unisensory areas to the multisensory area. Default is 18.

  • cross_modal_weight (float, optional) – The weight of the cross-modal synapses between unisensory areas. Default is 1.4.

  • causes_kind (str, optional) – The method used to calculate causes. Default is “count”.

  • causes_dim (str, optional) – The dimension in which to calculate causes. Default is “space”.

  • causes_peak_threshold (float, optional) – Peak threshold for causes calculation (default is 0.15).

Returns:

A tuple containing two elements: - response (dict): A dictionary with keys “auditory”, “visual”, and “multi” containing the results of the simulation for auditory, visual, and multisensory neurons respectively. - extra (dict): A dictionary with additional information, including causes parameters, and stimulus positions.

Return type:

tuple

calculate_causes(multi, causes_kind, causes_dim, causes_peak_threshold, causes_peak_distance, stim_position, **kwargs)[source]

Calculate the causes based on spatiotemporal activity peaks.

This method computes the causes (i.e., the underlying factors or sources) of multisensory activity based on the peaks in the multisensory data. The calculation considers the specified method and dimension for cause determination.

Parameters:
  • multi (array_like) – A 2D array of shape (time_points, neurons) representing the multisensory activity data from the simulation. The data is used to determine the spatiotemporal causes.

  • causes_kind (str) – The method used to determine the causes. This could refer to the type of analysis or metric for identifying causes. For example, it might specify whether to count occurrences or use some other measure.

  • causes_dim (str) – The dimension in which to calculate causes. This specifies whether the causes should be determined based on spatial or temporal peaks.

  • causes_peak_threshold (float) – Peak threshold for causes calculation.

  • stim_position (list of int) – A list containing the positions of the auditory and visual stimuli used in the simulation. These positions help in calculating the causes by providing context on where the stimuli were located.

  • **kwargs – Additional keyword arguments to be passed to the cause calculation function.

Returns:

causes – A dictionary containing the calculated causes. The structure of the dictionary will depend on the causes_kind and causes_dim parameters. It generally includes information about the detected causes based on the spatiotemporal activity data.

Return type:

dict