Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] remove error catches (try/except) in objectives #2403

Open
vmoens opened this issue Aug 27, 2024 · 2 comments
Open

[BUG] remove error catches (try/except) in objectives #2403

vmoens opened this issue Aug 27, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@vmoens
Copy link
Contributor

vmoens commented Aug 27, 2024

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.

@vmoens vmoens added the bug Something isn't working label Aug 27, 2024
@vmoens vmoens self-assigned this Aug 27, 2024
@albertbou92
Copy link
Contributor

albertbou92 commented Sep 7, 2024

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?

@vmoens
Copy link
Contributor Author

vmoens commented Sep 9, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants