inhomogeneous_poisson_bernoulli_approx¶
- inhomogeneous_poisson_bernoulli_approx(inputs: Tensor, step_time: float, *, generator: Generator | None = None) Tensor[source]¶
Generates a tensor of spikes approximating an inhomogeneous Poisson distribution.
This method takes in a tensor of frequencies over a number of time steps.
- Parameters:
inputs (torch.Tensor) – expected spike frequencies, \(f\), in \(\text{Hz}\).
step_time (float) – length of time between outputs, \(\Delta t\), in \(\text{ms}\).
generator (torch.Generator | None, optional) – pseudorandom number generator for sampling. Defaults to
None.
- Returns:
the generated spike train, time first.
- Return type:
Shape
inputs:\(S \times B \times N_0 \times \cdots\)
return:\(S \times B \times N_0 \times \cdots\)
- Where:
\(S\) is the number of steps for which to generate spikes.
\(B\) is the batch size.
\(N_0, \ldots\) are the dimensions of the spikes being generated.
Important
All elements of
inputsmust be nonnegative. Inputs will also be clamped if they exceed the maximum (i.e. if the expected value for the number of spikes in a time step is greater than 1).