deltaplus
#
Initialise parameters as a set of delta functions, plus Gaussian noise.
deltaplus_init
#
- hypercoil.init.deltaplus.deltaplus_init(*, shape: Tuple[int, ...], loc: Tuple[int, ...] | None = None, scale: float = 1, var: Tensor = 0.2, key: PRNGKey)[source]#
Delta-plus initialisation.
Initialise a tensor as a delta function added to Gaussian noise. This can be used to initialise filters for time series convolutions. The initialisation can be configured to produce a filter that approximately returns the input signal (or a lagged version of the input signal).
- Parameters:
- shapetuple
Shape of the tensor to initialise.
- loctuple or None (default None)
Location of the delta function expressed as an n-tuple of array coordinates along the last n axes of the tensor. Defaults to the centre of the tensor.
- scalefloat (default 1)
Magnitude of the delta function. Defaults to 1.
- varfloat or Tensor (default 0.2)
Variance of the Gaussian distribution from which the random noise is sampled. By default, noise is sampled i.i.d. for all entries in the tensor. To change the i.i.d. behaviour, use a tensor of floats that is broadcastable to the specified shape.
- keyjax.random.PRNGKey
Pseudo-random number generator key for sampling the Gaussian noise.
- Returns:
- None. The input tensor is initialised in-place.
DeltaPlusInitialiser
#
- class hypercoil.init.deltaplus.DeltaPlusInitialiser(loc: Tuple[int, ...] | None = None, scale: float = 1, var: Tensor = 0.2, mapper: Type[MappedParameter] | None = None)[source]#
Parameter initialiser following the delta-plus-noise scheme.
Initialise a tensor as a delta function added to Gaussian noise.
See
deltaplus_init_()
andMappedInitialiser
for usage details.- Attributes:
- loc
Methods
init
(model, *[, mapper, loc, scale, var, where])Initialise a parameter using the specified initialiser and mapper.