mygrad.nnet.initializers.dirac#
- mygrad.nnet.initializers.dirac(*shape: int, dtype=<class 'numpy.float32'>, constant: bool | None = None) Tensor[source]#
Initialize a
mygrad.Tensoraccording to the Dirac initialization procedure described by Zagoruyko and Komodakis.- Parameters:
- shapeSequence[int]
The shape of the output Tensor. Note that
shapemust 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.gradwill always returnNone).Defaults to
Falsefor float-type data. Defaults toTruefor integer-type data.Integer-type tensors must be constant.
- Returns:
- mygrad.Tensor, shape=``shape``
A Tensor, with values initialized according to the Dirac initialization.