Neuron¶
- class Neuron[source]¶
-
Base class for representing a group of neurons with a common mode of dynamics.
- abstract property batchedshape: tuple[int, ...]¶
Batch shape of the module
- Returns:
shape of the group of neurons, including batch size.
- Return type:
- Raises:
NotImplementedError –
batchedshapemust be implemented by the subclass.
- abstract property batchsz: int¶
Batch size of the neuron group.
- Parameters:
value (int) – new batch size.
- Returns:
present batch size.
- Return type:
- Raises:
NotImplementedError –
batchszmust be implemented by the subclass.
- abstract clear(**kwargs) None[source]¶
Resets neurons to their resting state.
- Raises:
NotImplementedError –
clearmust be implemented by the subclass.
- abstract property count: int¶
Number of neurons in the group.
- Returns:
number of neurons in the group.
- Return type:
- Raises:
NotImplementedError –
countmust be implemented by the subclass.
- abstract property dt: float¶
Length of the simulation time step, in milliseconds.
- Parameters:
value (float) – new simulation time step length.
- Returns:
present simulation time step length.
- Return type:
- Raises:
NotImplementedError –
dtmust be implemented by the subclass.
- abstract forward(inputs: Tensor, **kwargs) Tensor[source]¶
Runs a simulation step of the neuronal dynamics.
- Parameters:
inputs (torch.Tensor) – input currents to the neurons.
- Returns:
postsynaptic spikes from integration of inputs.
- Return type:
- Raises:
NotImplementedError –
forwardmust be implemented by the subclass.
- abstract property refrac: Tensor¶
Remaining refractory periods, in milliseconds.
- Parameters:
value (torch.Tensor) – new remaining refractory periods.
- Returns:
present remaining refractory periods.
- Return type:
- Raises:
NotImplementedError –
refracmust be implemented by the subclass.
- abstract property shape: tuple[int, ...]¶
Shape of the group of neurons.
- Returns:
shape of the group of neurons.
- Return type:
- Raises:
NotImplementedError –
shapemust be implemented by the subclass.
- abstract property spike: Tensor¶
Action potentials last generated.
- Returns:
- if the corresponding neuron generated an action potential
during the prior step.
- Return type:
- Raises:
NotImplementedError –
spikemust be implemented by the subclass.
- abstract property voltage: Tensor¶
Membrane voltages in millivolts.
- Parameters:
value (torch.Tensor) – new membrane voltages.
- Returns:
present membrane voltages.
- Return type:
- Raises:
NotImplementedError –
voltagemust be implemented by the subclass.