InfernoNeuron¶
- class InfernoNeuron(shape: tuple[int, ...] | int, batch_size: int)[source]¶
Bases:
BatchShapeMixin,NeuronBase class for neurons included in the Inferno library.
Unlike
Neuronwhich only defines an interface, this usesBatchShapeMixinto 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 –
clearmust 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 –
dtmust 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 –
forwardmust 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 –
refracmust 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 –
spikemust 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 –
voltagemust be implemented by the subclass.