I just found ADIC: http://www.mcs.anl.gov/research/projects/adic/
It is a pity that the license is not usable for Stan (maybe someone else has a look). But apart from that, the ADIC systems sounds amazing - you give it a piece of C source code and it generates you a c source code which gives you the partial derivatives. Having this, in particular, for the ODE integrator would be stunning.
Maybe there are similar systems out there already which have a better license?
Cheers,
Sebastian
https://github.com/vgvassilev/clad
this thing is again not usable for Stan (LGPL) and only works with clang, but it reads very cool:
http://llvm.org/devmtg/2013-11/slides/Vassilev-Poster.pdf
Sebastian
I am assuming here that doing code-generation will speed up the gradients considerably since the compiler can then take this code and make it optimized. Under this assumption: Is it thinkable to restrict the ODE system function in what is allowed and what not and do code generation for that? I mean, most ODE system functions are algebraically really simple and doing AD (which is great for its generality) is overkill.
I think even a much restricted set of operations which are allowed in a ODE system function would cover many cases. But of course, doing this "just" for ODEs... not sure.
Sebastian
PS: That this is a nobrainer to you... amazing. This looks like it would kill me.
On Tuesday, September 29, 2015 at 9:02:35 PM UTC+2, Bob Carpenter wrote:
> We've thought about code generation off and on. It's what
> Theano (Python) does.
>
> The problem is conditionals and branching. If we could get
> rid of all of those, code generation is a no-brainer. But if
> we'd done that, we woudn't have many of our matrix algorithms
> and would've taken a lot longer to get ODEs out, etc.
>
> We may still think about more in the future if we could
> limit Stan's language's expressiveness.
>
> - Bob
>
> > On Sep 29, 2015, at 3:40 AM,
> >