param#
- class brainstate.nn.init.param(parameter, sizes, batch_size=None, allow_none=True, allow_scalar=True)#
Initialize parameters.
- Parameters:
parameter (
Callable|Array|ndarray|bool|number|bool|int|float|complex|Quantity|State) – The initialization of the parameter. - If it is None, the created parameter will be None. - If it is a callable function \(f\), thef(size)will be returned. - If it is an instance ofinit.Initializer`, thef(size)will be returned. - If it is a tensor, then this function check whethertensor.shapeis equal to the givensize.allow_none (
bool) – Whether allow the parameter is None.allow_scalar (
bool) – Whether allow the parameter is a scalar value.
- Returns:
param – The initialized parameter.
- Return type:
See also
noise,state