xnn.dnn.models.physnet.semi_orthogonal_glorot_weights#

xnn.dnn.models.physnet.semi_orthogonal_glorot_weights(n_in, n_out, scale=2.0)[source]#

Random (semi-)orthogonal weights rescaled to Glorot variance.

Port of upstream layers/util.py: a random orthogonal matrix (QR of a standard-normal matrix) cropped to (n_in, n_out) and rescaled so its entries have variance scale / (n_in + n_out).

Returns:

Weight matrix of shape (n_in, n_out) in the default dtype.

Return type:

Tensor

Parameters: