How to have CCC Loss Function in PyTorch?
How would one write a custom loss function (in this case for CCC) for PyTorch that behaves similar to other losses like backwards()?


As long as you use PyTorch operators that are differentiable, your function will be too.
So, using torch.mean, torch.var, and torch.cov. Isn't that be what your looking for?
def CCCLoss(x, y):
    ccc = 2*torch.cov(x, y) / (x.var() + y.var() + (x.mean() - y.mean())**2)
    return ccc

