skneuromsi API

Scikit-neuromsi currently has three classes which implement neurocomputational models of multisensory integration.

The available modules are:

  • alais_burr2004: implements the near-optimal bimodal integration

    employed by Alais and Burr (2004) to reproduce the Ventriloquist Effect.

  • ernst_banks2002: implements the visual-haptic maximum-likelihood

    integrator employed by Ernst and Banks (2002) to reproduce the visual-haptic task.

  • kording2007: implements the Bayesian Causal Inference model for

    Multisensory Perception employed by Kording et al. (2007) to reproduce the Ventriloquist Effect.

In addition, there is a core module with features to facilitate the implementation of new models of multisensory integration.


Module skneuromsi.alais_burr2004

Module skneuromsi.ernst_banks2002

Module skneuromsi.kording2007

Module skneuromsi.core

Implementation of multisensory integration neurocomputational models in Python.

class skneuromsi.core.Stimulus(name, hyper_parameters, internal_values, run_inputs, function)[source]

Bases: object

Class for computing unisensory estimators.

name

Name of the estimator.

Type

attr.ib

hyper_parameters

Set of hyperparameters coming from a neural_msi_model.

Type

attr.ib

internal_values

Set of internal values coming from a neural_msi_model.

Type

attr.ib

run_inputs

Set of inputs coming from a neural_msi_model run.

Type

attr.ib

function

Callable that defines the computation of the unisensory estimate.

Type

attr.ib

class skneuromsi.core.Integration(name, hyper_parameters, internal_values, stimuli_results, function)[source]

Bases: object

Class for computing the multisensory estimator.

name

Name of the estimator.

Type

attr.ib

hyper_parameters

Set of hyperparameters coming from a neural_msi_model.

Type

attr.ib

internal_values

Set of internal values coming from a neural_msi_model.

Type

attr.ib

stimuli_results

Set of inputs coming from unisensory estimators.

Type

attr.ib

function

Callable that defines the computation of the multisensory estimate.

Type

attr.ib

class skneuromsi.core.Config(stimuli, integration)[source]

Bases: object

Class for configuring a neural_msi_model.

stimuli

List of skneuromsi.Stimulus that define the unisensory estimators of the neural_msi_model.

Type

attr.ib

integration

A skneuromsi.Integration that defines the multisensory estimator of the neural_msi_model.

Type

attr.ib

run_inputs

Set of inputs coming from a neural_msi_model run.

Type

attr.ib

get_model_values(model)[source]

Gets the hyperparameters and internals of the neural_msi_model.

run(model, inputs)[source]

Executes the multisensory integration.

skneuromsi.core.hparameter(**kwargs)[source]

Creates an hyperparameter attribute.

Parameters

**kwargs (dict, optional) – Extra arguments for the hyperparameter setup.

Returns

Hyperparameter attribute.

Return type

attr.ib

skneuromsi.core.internal(**kwargs)[source]

Creates an internal attribute.

Parameters

**kwargs (dict, optional) – Extra arguments for the internal setup.

Returns

Internal attribute.

Return type

attr.ib

skneuromsi.core.get_class_fields(cls)[source]

Gets the fields of a class.

Parameters

cls (class) – Class object relevant for the model, usually built on top of an estimator.

Returns

  • hparams (set) – Set containing the class attributes labeled as hyperparameters.

  • internals (set) – Set containing the class attributes labeled as internals.

skneuromsi.core.get_parameters(name, func, hyper_parameters, internal_values)[source]

Classifies the parameters of a function in hyperameters, internals or run inputs.

Parameters
  • name (str) – Name of the function.

  • func (callable) – Function to extract parameters from, usually an estimator.

  • hyper_parameters (set) – Set containing attributes labeled as hyperparameters.

  • internal_values (set) – Set containing the attributes labeled as internals.

Returns

  • shparams (set) – Set containing the function parameters classified as hyperparameters.

  • sinternals (set) – Set containing the function parameters classified as internals.

  • sinputs (set) – Set containing the function parameters classified as run inputs.

skneuromsi.core.change_run_signature(run, run_inputs)[source]

Modifies the signature of the run method of a neural_msi_model.

Parameters
  • run (callable) – Function that delegates all the parameters to the run method of a skneuromsi.Config class.

  • run_inputs (set) – Set containing the class attributes labeled as run inputs.

Returns

run – Run method with a new signature including the run_input parameters.

Return type

callable

skneuromsi.core.neural_msi_model(cls)[source]

Defines a class as a neural_msi_model.

Parameters

cls (class) – Class object of the model.

Returns

acls – Class with a neural_msi_model setup.

Return type

attr.s