mygrad.nnet.initializers.dirac#

mygrad.nnet.initializers.dirac(*shape: int, dtype=<class 'numpy.float32'>, constant: bool | None = None) Tensor[source]#

Initialize a mygrad.Tensor according to the Dirac initialization procedure described by Zagoruyko and Komodakis.

Parameters:
shapeSequence[int]

The shape of the output Tensor. Note that shape must be at least two-dimensional.

dtypedata-type, optional (default=float32)

The data type of the output tensor.

constantOptional[bool]

If True, this tensor is treated as a constant, and thus does not facilitate back propagation (i.e. constant.grad will always return None).

Defaults to False for float-type data. Defaults to True for integer-type data.

Integer-type tensors must be constant.

Returns:
mygrad.Tensor, shape=``shape``

A Tensor, with values initialized according to the Dirac initialization.