vis4d.op.loss.orthogonal_transform_loss

Orthogonal Transform Loss.

Classes

OrthogonalTransformRegularizationLoss([reducer])

Loss that punishes linear transformations that are not orthogonal.

class OrthogonalTransformRegularizationLoss(reducer=<function identity_loss>)[source]

Loss that punishes linear transformations that are not orthogonal.

Calculates difference of X’*X and identity matrix using norm( X’*X - I)

__call___(transforms)[source]

Calculates the loss.

Calculates difference of X’*X and the identity matrix using norm(X’*X - I) for each transformation

Parameters:

transforms (list[Tensor]) – (list(torch.tensor)) list with transformation matrices batched ([N, 3, 3], [N, x, x], ….)

Return type:

Tensor

Returns:

torch.Tensor containing the mean loss value (mean(norm(X’*X - I)))

forward(transforms)[source]

Calculates the loss.

Calculates difference of X’*X and the identity matrix using norm(X’*X - I) for each transformation

Parameters:

transforms (list[Tensor]) – (list(torch.tensor)) list with transformation matrices batched ([N, 3, 3], [N, x, x], ….)

Return type:

Tensor

Returns:

torch.Tensor containing the mean loss value (mean(norm(X’*X - I)))