PearsonCorrelation
- class lightning_ir.loss.listwise.PearsonCorrelation[source]
Bases:
ListwiseLossFunctionPearson Correlation loss for listwise ranking tasks.
Methods
compute_loss(output, batch)Compute the Pearson Correlation loss.
- compute_loss(output: LightningIROutput, batch: TrainBatch) torch.Tensor[source]
Compute the Pearson Correlation loss.
- Parameters:
output (LightningIROutput) – The output from the model containing scores.
batch (TrainBatch) – The training batch containing targets.
- Returns:
The computed loss.
- Return type:
torch.Tensor