jaxsnn.discrete.modules
Modules
Functions
-
jaxsnn.discrete.modules.Input(size: int) → jaxsnn.discrete.types.SourcePopulation Create an input layer descriptor.
It returns None for the generator because it’s is not needed.
- Parameters
size – Number of neurons in the input layer.
- Returns
A SourcePopulation instance representing the input layer.
-
jaxsnn.discrete.modules.LI(size: int, params: jaxsnn.discrete.functional.li.LIParameters = LIParameters(tau_syn=0.005, tau_mem=0.01, v_leak=0.0)) → jaxsnn.discrete.types.Population Layer constructor function for a leaky-integrator layer.
- Parameters
size – Number of neurons in the layer.
params – Parameters for the LI neuron model.
- Returns
A Population object containing the layer definition.
-
jaxsnn.discrete.modules.LIF(size, params: jaxsnn.discrete.functional.lif.LIFParameters = LIFParameters(tau_syn=0.005, tau_mem=0.01, v_th=0.6, v_leak=0.0, v_reset=0.0), method: Callable = <jax._src.custom_derivatives.custom_vjp object>) → jaxsnn.discrete.types.Population Layer constructor function for a leaky-integrate and fire layer.
- Parameters
size – Number of neurons in the layer.
params – Parameters for the LIF neuron model.
method – Surrogate gradient method for the threshold function.
- Returns
A Population object containing the layer definition.
-
jaxsnn.discrete.modules.Linear(mean: float = 0.5, std: float = 2.0, pre_weights: Optional[jax.Array, None] = None) → jaxsnn.discrete.types.Projection Creates a linear projection layer
- Either:
initialize weights from a Gaussian (mean, std), or
provide a concrete weight array.
- Parameters
mean – Mean value for weight initialization.
std – Standard deviation for weight initialization.
pre_weights – Optional weight array. If provided, mean and std are ignored.
- Returns
A Projection object containing the layer definition.