rl
rl copied to clipboard
[BUG] remove error catches (try/except) in objectives
We still have a bunch of try/except in losses such as PPO to compute the entropy. We need to remove them for compile compatibility.
even if if never catches the exception is try/except still problematic? for example if the code to compute the entropy is the following:
try:
e = dist.entropy()
except NotImplementedError:
x = dist.rsample((samples_mc,))
e = -dist.log_prob(x).mean(0)
And we run it with a dist with the entropy method implemented. Will then be compatible with compile? I guess so right?
Compile will be happy, but not when it's not available and then the error won't be very clear. Because we know if advance if the distribution has an entropy function, we should patch that.