Shortcuts

CrossCorrelationLoss

class mmpretrain.models.losses.CrossCorrelationLoss(lambd=0.0051)[source]

Cross correlation loss function.

Compute the on-diagnal and off-diagnal loss.

Parameters:

lambd (float) – The weight for the off-diag loss.

forward(cross_correlation_matrix)[source]

Forward function of cross correlation loss.

Parameters:

cross_correlation_matrix (torch.Tensor) – The cross correlation matrix.

Returns:

cross correlation loss.

Return type:

torch.Tensor

off_diagonal(x)[source]

Rreturn a flattened view of the off-diagonal elements of a square matrix.

Read the Docs v: latest
Versions
latest
stable
mmcls-1.x
mmcls-0.x
dev
Downloads
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.