nn_init_orthogonal_ function

Orthogonal initialization

Orthogonal initialization

Fills the input Tensor with a (semi) orthogonal matrix, as described in Exact solutions to the nonlinear dynamics of learning in deep linearneural networks - Saxe, A. et al. (2013). The input tensor must have at least 2 dimensions, and for tensors with more than 2 dimensions the trailing dimensions are flattened.

nn_init_orthogonal_(tensor, gain = 1)

Arguments

  • tensor: an n-dimensional Tensor
  • gain: optional scaling factor

Examples

if (torch_is_installed()) { w <- torch_empty(3, 5) nn_init_orthogonal_(w) }
  • Maintainer: Daniel Falbel
  • License: MIT + file LICENSE
  • Last published: 2025-02-14

Downloads (last 30 days):