InfernoNeuron¶
- class InfernoNeuron(shape: tuple[int, ...] | int, batch_size: int)[source]¶
Bases:
BatchShapeMixin
,Neuron
Base class for neurons included in the Inferno library.
Unlike
Neuron
which only defines an interface, this usesBatchShapeMixin
to work with the included mixins to automatically reshape batch-size dependent buffers and parameters.It also assumes
clear()
will be implemented so it can be called without arguments and will, by default, not reset state which should persist, such as adaptations.- clear(**kwargs) None [source]¶
Resets neurons to their resting state.
- Raises:
NotImplementedError –
clear
must be implemented by the subclass.
- 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 –
dt
must be implemented by the subclass.
- 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 –
forward
must be implemented by the subclass.
- 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 –
refrac
must be implemented by the subclass.
- property spike: Tensor¶
Action potentials last generated.
- Returns:
- if the corresponding neuron generated an action potential
during the prior step.
- Return type:
- Raises:
NotImplementedError –
spike
must be implemented by the subclass.
- property voltage: Tensor¶
Membrane voltages in millivolts.
- Parameters:
value (torch.Tensor) – new membrane voltages.
- Returns:
present membrane voltages.
- Return type:
- Raises:
NotImplementedError –
voltage
must be implemented by the subclass.