myogen.simulator.MotorNeuronPool.generate_spike_trains#

MotorNeuronPool.generate_spike_trains(
input_current__matrix=None,
cortical_input__matrix=None,
timestep__ms=0.05,
noise_mean__nA=30,
noise_stdev__nA=30,
CST_number=400,
connection_prob=0.3,
what_to_record=[{'variables': ['v'], 'locations': ['dendrite', 'soma']}],
)[source]#

Generate the spike trains for as many neuron pools as input currents there are

Each motor neuron pools have each “neurons_per_pool” neurons. The input currents are injected into each pool, and the spike trains are recorded.

Parameters:
  • input_current__matrix (INPUT_CURRENT__MATRIX, optional) – Matrix of shape (n_pools, t_points) containing current values Each row represents the current for one pool

  • cortical_input__matrix (CORTICAL_INPUT__MATRIX, optional) – Matrix of shape (n_pools, t_points) containing cortical input values Each row represents the cortical input for one pool

  • timestep__ms (float) – Simulation timestep__ms in ms

  • noise_mean__nA (float) – Mean of the noise current in nA

  • noise_stdev__nA (float) – Standard deviation of the noise current in nA

  • CST_number (int) – Number of neurons in the cortical input population. Only used if cortical_input__matrix is provided. Default is 400.

  • connection_prob (float) – Probability of a connection between a cortical input neuron and a motor neuron. Only used if cortical_input__matrix is provided. Default is 0.3.

  • what_to_record (list[dict['variables', 'to_file', 'sampling_interval', 'locations'], Any]) –

    List of dictionaries specifying what to record.

    Each dictionary contains the following keys:
    • variables: list of strings specifying the variables to record

    • to_file: bool specifying whether to save the recorded data to a file

    • sampling_interval: int specifying the sampling interval in ms

    • locations: list of strings specifying the locations to record from

    See pyNN documentation for more details: https://pynn.readthedocs.io/en/stable/recording.html.

    Spike trains are recorded by default.

Returns:

  • spike_trains (SPIKE_TRAIN__MATRIX) – Matrix of shape (n_pools, neurons_per_pool, t_points) containing spike trains Each row represents the spike train for one pool Each column represents the spike train for one neuron Each element represents whether the neuron spiked at that time point

  • active_neuron_indices (list[numpy.ndarray]) – List of arrays of indices of the active neurons in each pool

  • data (list[neo.core.segment.Segment]) – List of neo segments containing the recorded data

Return type:

tuple[Annotated[ndarray[tuple[int, …], dtype[bool]], beartype.vale.Is[lambda x: x.ndim == 3]], list[ndarray], list[Segment]]