pyro-ppl / funsor

Functional tensors for probabilistic programming
https://funsor.pyro.ai
Apache License 2.0
234 stars 21 forks source link

ODEs, PDEs, quadrature, and finite element analysis #497

Open fritzo opened 3 years ago

fritzo commented 3 years ago
  1. Could we express ODEs in Funsor and then solve them via (approximate) numerical integration methods?
  2. Could we express PDEs in Funsor and then solve them via (approximate) finite element methods, possibly wrapping a backend like FEniCS?
```py @make_funsor def Curl( field: Funsor[Reals[3]], position: Bound, position2: Fresh[Reals[3]], ) -> Reals[3]: pass # TODO relies on full autograd implementation @eager.register(Curl, Tensor, ...): return 0 def pressure( velocity: Reals[3], density: Real, ) -> Real: pass # The following are equivalent: with SimplicialMesh(x=my_mesh): velocity = ... assert velocity.inputs["x"] == Reals[3] @SimplicialMesh.register(Curl, ...) def meshed_curl_operator(...): ... velocity = ... assert velocity.inputs["x"] == Bint[my_mesh.num_vertices] ```
fritzo commented 2 years ago
  1. Could we pose an ODE as a variational problem and solve with an argmax sum-product computation? In particular, could we have both local variables and global variables wrt a continuous time "plate"?