Shortcuts

CrossCorrelationLoss

class mmpretrain.models.losses.CrossCorrelationLoss(lambd=0.0051)[源代码]

Cross correlation loss function.

Compute the on-diagnal and off-diagnal loss.

参数:

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

forward(cross_correlation_matrix)[源代码]

Forward function of cross correlation loss.

参数:

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

返回:

cross correlation loss.

返回类型:

torch.Tensor

off_diagonal(x)[源代码]

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.