mlx.nn.init.orthogonal

Contents

mlx.nn.init.orthogonal#

orthogonal(gain: float = 1.0, dtype: Dtype = mlx.core.float32) Callable[[array], array]#

An initializer that returns an orthogonal matrix.

Parameters:
  • gain (float, optional) – Scaling factor for the orthogonal matrix. Default: 1.0.

  • dtype (Dtype, optional) – Data type of the array. Default: float32.

Returns:

An initializer that returns an orthogonal matrix with the same shape as the input.

Return type:

Callable[[array], array]