orthogonal#

torchdyno.models.initializers.orthogonal(shape, dtype=torch.float32)[source]#
Orthogonal matrix. See:

F. Mezzadri (2007). How to Generate Random Matrices from the Classical Compact Groups. Notices of the American Mathematical Society, 54(5), pp. 592-604. https://www.ams.org/notices/200705/fea-mezzadri-web.pdf

Parameters:
  • shape (torch.Size) – shape of the tensor.

  • gain (float, optional) – scaling value. Defaults to 1.

  • dtype (dtype)

Returns:

initialized orthogonal tensor.

Return type:

torch.Tensor