peal.training.criterions.orthogonality_criterion¶
- peal.training.criterions.orthogonality_criterion(model, pred, y, latent_code=None)[source]¶
Penalise non-orthogonal weight matrices of
model.Every parameter with two or more dimensions is reshaped to
[out, in](conv kernels are flattened overin * kh * kw) and the Frobenius norm ofW W^T - Iis summed. Vectors (biases, norm weights) are skipped.pred,yandlatent_codeare ignored.- Returns:
Scalar penalty on the model’s device.
- Return type: