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

Question: Different results for Boxconstraints with torch.clamp vs cvxpy layers #140

Open
philippkiesling opened this issue Feb 20, 2023 · 0 comments

Comments

@philippkiesling
Copy link

Hi everybody,

I am training a reinforcement learning agent with one dimensional continuous action space. I want to restrict the action space, such that the agent can only choose valid actions (This constraint changes depending on the current state).

Therefore I tried two approaches to limiting the action space:

To my surprise, however, they yield completely different results: The torch.clamp version does not converge to a good solution, while the cvxpylayer does.
Is there any explanation for this?

All the best,
Philipp

The gradient of both functions

Forward pass of both functions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant