stimulus_CM

class nrv.optim.optim_utils.stimulus_CM(stim_ID: int = 0, interpolator: callable = None, intrep_kwargs: dict = {}, stim_gen: callable = None, stim_gen_kwargs: dict = {}, extracel_context: bool = True, intracel_context: bool = False, rec_context: bool = False, **kwargs)[source]

Generic context modifier which generate a stimulus from the input tuning parameters.

Note

When an instance of this class is called the three following steps are done:
  1. The input vector is interpolated with the interpolator. If not set, the interpolated vector will be the equal to the input vector.

  2. The stimulus is generated from interpolated values with stim_gen function. If not set, interpolated values are set for the stimulus amplitude at constant sample rate (from zero to an argument t_sim)

  3. The generated stimulus is added to an electrode of a static context.

Parameters:
  • stim_ID (int, optional) – ID of the electrode which should be adapted, by default 0

  • interpolator (callable, optional) – if not None function use to interpolate the input vector, by default None

  • intrep_kwargs (dict, optional) – key arguments to use with the interpolator, by default {}

  • stim_gen (callable, optional) – function use to generate the stimulus from the interpolated values, by default None

  • stim_gen_kwargs (dict, optional) – key arguments used for the , by default {}

  • extracel_context (bool) – specifies whether to load extracel_context with the static context

  • intracel_context (bool) – specifies whether to load intracel_context with the static context

  • rec_context (bool) – specifies whether to load rec_context with the static context

Methods

stimulus_CM.__init__([stim_ID, ...])

Init method for NRV_class

stimulus_CM.get_parameters()

Generic method returning all the atributes of an NRV_class instance

stimulus_CM.interpolate(X)

interpolate the input vector with the interpolator.

stimulus_CM.load(data[, blacklist])

Generic loading method for NRV_class instance

stimulus_CM.save([save, fname, blacklist])

Generic saving method for NRV_class instance.

stimulus_CM.set_parameters(**kawrgs)

Generic method to set any attribute of NRV_class instance

stimulus_CM.stimulus_generator(X_interp)

generated from interpolated values with stim_gen function.