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

[Feature]: Make sympy2torch export functions, not objects #435

Open
MilesCranmer opened this issue Sep 29, 2023 · 0 comments
Open

[Feature]: Make sympy2torch export functions, not objects #435

MilesCranmer opened this issue Sep 29, 2023 · 0 comments
Labels
enhancement New feature or request priority: low

Comments

@MilesCranmer
Copy link
Owner

Feature Request

Right now sympy2jax is functional. It returns a dictionary containing a function and some parameters. However, sympy2torch is object-oriented. It returns a module.

I think the functional approach is a bit simpler so would reduce maintenance burden. From my experience trying to add sympy.Piecewise in #433, it's quite a bit of work. Therefore, for torch export, you would basically have a tensor of parameters and a function that takes that tensor and an array input. So you could do what you like with that, including putting it inside a class. But it's harder to go the other way, from an exported object back to a function.

The functional approach is also better for MCMC'ing parameters, which you can't really do with the PyTorch export right now.

@MilesCranmer MilesCranmer added the enhancement New feature or request label Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority: low
Projects
None yet
Development

No branches or pull requests

1 participant