skneuromsi.neural._paredes2025 module
- class skneuromsi.neural._paredes2025.Paredes2025Integrator(tau: tuple, s: float, theta: float, name: str = 'Paredes2025Integrator')[source]
Bases:
objectA class representing the integrator for the Paredes2025 model.
- tau: tuple
- s: float
- theta: float
- name: str = 'Paredes2025Integrator'
- class skneuromsi.neural._paredes2025.Paredes2025TemporalFilter(tau: tuple, name: str = 'Paredes2025TemporalFilter')[source]
Bases:
objectTemporal filter for the Paredes2025 model.
- tau: tuple
- name: str = 'Paredes2025TemporalFilter'
- class skneuromsi.neural._paredes2025.Paredes2025(*, neurons=90, tau=(15, 25, 5), tau_neurons=1, s=2, theta=16, seed=None, mode0='auditory', mode1='visual', position_range=(0, 90), position_res=1, time_range=(0, 200), time_res=0.01, **integrator_kws)[source]
Bases:
SKNMSIMethodABCCausal Inference Network Model of Paredes et al. (2025).
This model builds upon previous network models for multisensory integration (Cuppini et al., 2014; Cuppini et al., 2017) and consists of three layers: two unisensory layers (auditory and visual) and a multisensory layer. The unisensory layers encode auditory and visual stimuli separately and connect to the multisensory layer via feedforward and feedback synapses.
The model computes implicit causal inference at the unisensory layers and explicit causal inference at the multisensory layer, mimicking the responses of neurons in the parietal-temporal association cortices.
References
[Cuppini et al., 2014] [Cuppini et al., 2017] [Paredes et al., 2025]
Notes
The Paredes2025 model maintains the neural connectivity (lateral, crossmodal, feedforward) and inputs as described in the network presented in Cuppini et al. (2017).
This new model includes feedback connectivity and temporal filters as detailed below.
The feedback synaptic weights are calculated using:
\[B^{cm}_{jk} = B^{cm}_{0} \cdot \exp \left( - \frac{\left(D_{jk}\right)^{2}}{2 \left(\sigma^{cm}\right)^{2}} \right)\]where:
\(B^{cm}_{0}\): Highest level of synaptic efficacy.
\(D_{jk}\): Distance between neuron at position \(j\) in the post-synaptic unisensory region and neuron at position \(k\) in the pre-synaptic multisensory region.
\(\sigma^{cm}\): Width of the feedback synapses, which is the same for both auditory-to-multisensory (\(am\)) and visual-to-multisensory (\(vm\)) connections.
The overall feedback input to the unisensory neurons is given by:
\[b^{c}_{j}\left(t\right) = \sum^{N}_{k=1} B^{cm}_{jk} \cdot y^{c}_{k}\left(t - \Delta t_{feed}\right)\]where \(\Delta t_{feed}\) represents the latency of feedback inputs between the multisensory and unisensory regions.
The feedback synaptic weights are symmetrically defined:
\[B_{0}^{am} = B_{0}^{vm} \quad \text{and} \quad \sigma^{am} = \sigma^{vm}\]The external sources in unisensory regions are filtered using a second-order differential equation:
\[\begin{split}\left\{ \begin{matrix} \frac{d}{dt} o^{c}_{j}\left(t\right) = \delta^{c}_{j} \left(t\right) \\ \frac{d}{dt} \delta^{c}_{j} \left(t\right) = \frac{G^{c}}{\tau^{c}} \cdot \left[ e^{c}_{j}\left(t\right) + c^{c}_{j}\left(t\right) + b^{c}_{j}\left(t\right) + n^{c}_{j} \right] - \frac{2 \cdot \delta^{c}_{j} \left(t\right)}{\tau^{c}} - \frac{o^{c}_{j}\left(t\right)}{\left( \tau^{c} \right)^{2}} \end{matrix} \right.\end{split}\]where:
\(G^{c}\): Gain of the unisensory regions.
\(\tau^{c}\): Time constant of the unisensory regions.
\(c\) : Indicates the unisensory region (auditory or visual).
The external sources in multisensory regions are filtered using a second-order differential equation:
\[\begin{split}\left\{ \begin{matrix} \frac{d}{dt} o^{m}_{j}\left(t\right) = \delta^{m}_{j} \left(t\right) \\ \frac{d}{dt} \delta^{m}_{j} \left(t\right) = \frac{G^{m}}{\tau^{m}} \cdot \left[ i^{m}_{j}\left(t\right) \right] - \frac{2 \cdot \delta^{m}_{j} \left(t\right)}{\tau^{m}} - \frac{o^{m}_{j}\left(t\right)}{\left( \tau^{m} \right)^{2}} \end{matrix} \right.\end{split}\]where:
\(G^{m}\): Gain of the multisensory regions.
\(\tau^{m}\): Time constant of the multisensory regions.
The cross-modal input to the unisensory neurons is calculated as:
\[\begin{split}\begin{matrix} c^{a}_{j}\left(t\right) = \sum^{N}_{k=1} W^{av}_{jk} \cdot y^{v}_{k} \left(t - \Delta t_{cross} \right) \\ c^{v}_{j}\left(t\right) = \sum^{N}_{k=1} W^{va}_{jk} \cdot y^{a}_{k} \left(t - \Delta t_{cross}\right) \end{matrix}\end{split}\]where \(\Delta t_{cross}\) represents the latency of cross-modal inputs between the unisensory regions.
- property neurons
Returns the number of neurons in the network.
- Returns:
The number of neurons.
- Return type:
int
- property tau_neurons
Returns the time constant for the neuron integrator.
- Returns:
The time constant for the neuron integrator.
- Return type:
float
- property tau
Returns the time constants for the temporal filters.
- Returns:
The time constants for the temporal filters.
- Return type:
tuple of 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
Returns the random number generator.
- Returns:
The random number
- Return type:
np.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)
instance (The random number generator to be used. It should be an)
numpy.random.Generator. (of)
- run(*, auditory_soa=50, visual_soa=None, auditory_onset=16, visual_onset=16, auditory_duration=7, visual_duration=12, auditory_position=None, visual_position=None, auditory_intensity=2.4, visual_intensity=1.4, auditory_sigma=32, visual_sigma=4, noise=False, noise_level=0.4, temporal_noise=False, temporal_noise_scale=5, lateral_excitation=2, lateral_excitation_sigma=3, lateral_inhibition=1.8, lateral_inhibition_sigma=24, cross_modal_weight=0.075, cross_modal_latency=16, feed_latency=95, feedback_weight=0.1, feedforward_weight=1.4, auditory_gain=None, visual_gain=None, multisensory_gain=None, auditory_stim_n=2, visual_stim_n=1, feedforward_pruning_threshold=0, cross_modal_pruning_threshold=0, causes_kind='count', causes_dim='space', causes_peak_threshold=0.8, causes_peak_distance=None)[source]
Runs the model simulation with specified parameters.
- Parameters:
auditory_soa (float, optional) – Stimulus-onset asynchrony for auditory stimuli (default is 50).
visual_soa (float, optional) – Stimulus-onset asynchrony for visual stimuli (default is None).
auditory_onset (float, optional) – Onset time for auditory stimuli (default is 16).
visual_onset (float, optional) – Onset time for visual stimuli (default is 16).
auditory_duration (float, optional) – Duration of auditory stimuli (default is 7).
visual_duration (float, optional) – Duration of visual stimuli (default is 12).
auditory_position (float, optional) – Position of auditory stimuli (default is middle of the range).
visual_position (float, optional) – Position of visual stimuli (default is middle of the range).
auditory_intensity (float, optional) – Intensity of auditory stimuli (default is 2.4).
visual_intensity (float, optional) – Intensity of visual stimuli (default is 1.4).
auditory_sigma (float, optional) – Standard deviation for auditory stimuli (default is 32).
visual_sigma (float, optional) – Standard deviation for visual stimuli (default is 4).
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).
temporal_noise (bool, optional) – Whether to include temporal noise (default is False).
temporal_noise_scale (float, optional) – Scale of temporal noise (default is 5).
lateral_excitation (float, optional) – Lateral excitation weight parameter (default is 2).
lateral_excitation_sigma (float, optional) – Lateral excitation spread parameter (default is 3).
lateral_inhibition (float, optional) – Lateral inhibition weight parameter (default is 1.8).
lateral_inhibition_sigma (float, optional) – Lateral inhibition spread parameter (default is 24).
cross_modal_weight (float, optional) – Weight for cross-modal connections (default is 0.075).
cross_modal_latency (float, optional) – Latency for cross-modal inputs (default is 16).
feed_latency (float, optional) – Latency for feedforward inputs (default is 95).
feedback_weight (float, optional) – Weight for feedback connections (default is 0.10).
feedforward_weight (float, optional) – Weight for feedforward connections (default is 1.4).
auditory_gain (float, optional) – Gain for auditory processing (default is None, which sets to exp(1)).
visual_gain (float, optional) – Gain for visual processing (default is None, which sets to exp(1)).
multisensory_gain (float, optional) – Gain for multisensory processing (default is None, which sets to exp(1)).
auditory_stim_n (int, optional) – Number of auditory stimuli (default is 2).
visual_stim_n (int, optional) – Number of visual stimuli (default is 1).
feedforward_pruning_threshold (float, optional) – Threshold for pruning feedforward synapses (default is 0).
cross_modal_pruning_threshold (float, optional) – Threshold for pruning cross-modal synapses (default is 0).
causes_kind (str, optional) – Method for calculating causes (“count” or other) (default is “count”).
causes_dim (str, optional) – Dimension for calculating causes (“space” or other) (default is “space”).
causes_peak_threshold (float, optional) – Peak threshold for causes calculation (default is 0.80).
- Returns:
A tuple containing: - response (dict): A dictionary with keys “auditory”, “visual”, and “multi”, containing the simulation results for each layer. - extra (dict): A dictionary with additional information such as total inputs, 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 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 (np.ndarray) – Multisensory activity data.
causes_kind (str) – Method for calculating causes (“count” or other).
causes_dim (str) – Dimension for calculating causes (“space” or other).
causes_peak_threshold (float) – Peak threshold for causes calculation.
stim_position (list of float) – List containing the positions of the stimuli.
**kwargs (keyword arguments) – Additional arguments for the causes calculation.
- Returns:
causes – Calculated causes based on the specified method and parameters.
- Return type:
np.ndarray