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

Explore solutions for enhancing OOP in high-level resources #52

Closed
diegoferigo opened this issue Oct 9, 2023 · 2 comments · Fixed by #123
Closed

Explore solutions for enhancing OOP in high-level resources #52

diegoferigo opened this issue Oct 9, 2023 · 2 comments · Fixed by #123
Assignees

Comments

@diegoferigo
Copy link
Member

Although JAX promotes a functional programming pattern, it's often useful offering to downstream users also OOP resources that usually simplify the learning curve.

Jaxsim follows a similar approach:

We are currently trying to simplify the application of jit/vmap transformations (see #44 and #48), but there are some use-cases related to r/w classes like high_level.link.Link and high_level.joint.Joint that are still a bit rough (see 48#issuecomment-1746635121).

It would be interesting exploring solutions like those discussed in jax-ml/jax#7919 and jax-ml/jax#17341, with some extra detail provided in #48 (comment).

@diegoferigo
Copy link
Member Author

We eventually decided to migrate towards functional APIs. The OOP resources have been removed and merged into main in #108.

@diegoferigo diegoferigo self-assigned this Mar 27, 2024
@diegoferigo
Copy link
Member Author

For those reading this issue in mid 2024, there's an experimental attempt of using PyDags for OOP in Flax:

https://flax.readthedocs.io/en/v0.8.3/experimental/nnx/nnx_basics.html

In their case, the new classes hold both the NN structure and the state (parameters). A caveat -at first look- is that they had to create a new decorator (rings a bell with our previous OOP pattern) for JIT compilation to handle stateful arguments.

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

Successfully merging a pull request may close this issue.

1 participant