logo

Function neuronika::nn::init::dirac[][src]

pub fn dirac<D: Dimension>(param: &Learnable<D>, groups: usize)
Expand description

Fills the {3, 4, 5}-dimensional differentiable leaf variable with the Dirac delta function.

Preserves the identity of the inputs in convolutional layers, where as many input channels are preserved as possible. In case of groups > 1, each group of channels preserves identity.

Arguments

  • param - differentiable variable to initialize.

  • groups - number of groups.

Panics

If the differentiable variable is not {3, 4, 5}-dimensional and the number of output channels is not divisible by groups. The number of output channels is equal to the length of the first axis of param’s data.