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

Adding support of FEniCS models #25

Closed
IvanYashchuk opened this issue Aug 15, 2020 · 2 comments
Closed

Adding support of FEniCS models #25

IvanYashchuk opened this issue Aug 15, 2020 · 2 comments

Comments

@IvanYashchuk
Copy link

I've made a small package for embedding FEniCS PDE solvers in Theano.
https://github.com/IvanYashchuk/fenics-pymc3
The current API is just one function create_fenics_theano_op which turns a normal Python function, which expects FEniCS inputs and outputs a solution to the problem, into a differentiable Theano Op that can be directly used in a PyMC3 model.
This function can be used as a decorator (with @create_fenics_theano_op syntax) as well.
@junpenglao suggested that it could of interest to port it here. What do other people think about this?
I'm not well familiar with the code structure here, what would be a good place for this FEniCS integration functionality?
Also if we get to the point of having FEniCS support here, we should also make it work with Firedrake, which has more or less the same Python interface as FEniCS, but a different backend.

@brandonwillard
Copy link
Member

Those Ops are too specialized for addition into core Theano.

I don't know enough about FEniCS, but—from a cursory investigation—the only relevant additions that could be included here might involve bridging explicit FEniCS graph objects and operators with existing and/or new Ops in Theano.

In other words, it might be worth considering FEniCS as a compilation target like we're doing with JAX here. Unfortunately, I can't say whether or not that's possible or even worthwhile.

@twiecki
Copy link
Contributor

twiecki commented Aug 17, 2020

Agree with @brandonwillard, but such a theano Op would be great to have in your fenics-wrapper library.

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

3 participants