MIR.image_similarity.PCC

class MIR.image_similarity.PCC(*args, **kwargs)[source]

Global Pearson correlation coefficient (PCC) loss.

Computes the PCC over all channels and voxels of each sample and returns 1 - PCC averaged over the batch. The reductions are hard-coded over dims [1, 2, 3, 4], so inputs must be 5D ([B, C, H, W, D]). The constructor takes no arguments.

__init__()[source]

Methods

__init__()

forward(I, J)

Return 1 - PCC as a loss to minimise.

pcc(y_true, y_pred)

Compute the Pearson correlation coefficient.