pyiqa.losses.iqa_losses¶
Module Contents¶
- pyiqa.losses.iqa_losses.emd_loss(pred, target, r=2)[source]¶
- Parameters:
pred (Tensor) – of shape (N, C). Predicted tensor.
target (Tensor) – of shape (N, C). Ground truth tensor.
r (float) – norm level, default l2 norm.
- class pyiqa.losses.iqa_losses.EMDLoss(loss_weight=1.0, r=2, reduction='mean')[source]¶
Bases:
torch.nn.ModuleEMD (earth mover distance) loss.
- pyiqa.losses.iqa_losses.plcc_loss(pred, target)[source]¶
- Parameters:
pred (Tensor) – of shape (N, 1). Predicted tensor.
target (Tensor) – of shape (N, 1). Ground truth tensor.
- class pyiqa.losses.iqa_losses.PLCCLoss(loss_weight=1.0)[source]¶
Bases:
torch.nn.ModulePLCC loss, induced from Pearson’s Linear Correlation Coefficient.
- class pyiqa.losses.iqa_losses.RankLoss(detach=False, loss_weight=1.0)[source]¶
Bases:
torch.nn.ModuleMonotonicity regularization loss, will be zero when rankings of pred and target are the same.
- pyiqa.losses.iqa_losses.norm_loss_with_normalization(pred, target, p, q)[source]¶
- Parameters:
pred (Tensor) – of shape (N, 1). Predicted tensor.
target (Tensor) – of shape (N, 1). Ground truth tensor.
- class pyiqa.losses.iqa_losses.NiNLoss(loss_weight=1.0, p=1, q=2)[source]¶
Bases:
torch.nn.ModuleNiN (Norm in Norm) loss
Reference:
Dingquan Li, Tingting Jiang, and Ming Jiang. Norm-in-Norm Loss with Faster Convergence and Better Performance for Image Quality Assessment. ACMM2020.
This loss can be simply described as: l1_norm(normalize(pred - pred_mean), normalize(target - target_mean))