Callbacks to add parametrized loss function

Hello everyone,
Have been trying to implement this “Robust Loss” for regression problems:

They have two version, one that is fixed, and one that is adaptive, so they have two parameters added to the optimisation.

  • What is the best way to add this to fastai2, to integrate with the Callbacks system.

Generally speaking, the loss function is:

L(inp, targ, sigma)

where sigma is trainable.

Also just defining params on the loss function is giving me issues about CUDA (that my tensors are not on the right device).

Any advise would be welcomed. I think it would be nice to have an extra continuous loss to fastai2.

This seem like a really interesting project. Were you able to get it running?

No, had no time, but I am tempted to try it out.