jonbarron / robust_loss_pytorch

A pytorch port of google-research/google-research/robust_loss/
Apache License 2.0
656 stars 88 forks source link

Usage of draw_sample function #23

Closed ghost closed 3 years ago

ghost commented 3 years ago

Hi Jonathan,

Thanks for your paper and code, they are amazing. May I ask several questions?

  1. The usage of draw_sample function in distribution.py? If I just want to use adaptive loss as a loss function(adaptive alpha and c), do I need draw_sample?
  2. For the probability density function, I see the \u(mean) in the paper, however it is not represented in the code, Do I need to preprocess input data to have zero mean?

Thanks for your help.

jonbarron commented 3 years ago

1) draw_sample is only for drawing samples, which is not necessary if you just want to use the adaptive loss. 2) The input to the loss function is assumed to be the difference between y and \mu. You'll want to predict a mu and then subtract it from the datapoint labels you're trying to regress to.

ghost commented 3 years ago

Thanks for your reply!