shogun-toolbox / shogun

Shōgun
http://shogun-toolbox.org
BSD 3-Clause "New" or "Revised" License
3.03k stars 1.04k forks source link

Mathematical expressions -> C++ code (and autodiff) #2877

Open karlnapf opened 9 years ago

karlnapf commented 9 years ago

I feel like Shogun could use a way of defining mathematical expressions, such as

in a meta-langauge (much like stan does it), which is then at compile time translated into c++ code, which is then compiled. This would allow to essentially specify new kernel or cost functions as strings. The advantage of such a system is also that gradients can be computed automatically. In particular for our kernel functions, this would be extremely useful. There are libraries that can do such things.

Stan is an example. They define more complicated things than just mathematical expressions and load data, but the core idea is very similar, see example

karlnapf commented 9 years ago

Related to:

karlnapf commented 9 years ago

Turns out the stan people finally took out their math library of the rest of the framework: https://github.com/stan-dev/math

yorkerlin commented 9 years ago

It should be related to https://github.com/shogun-toolbox/shogun/pull/2876 (see the FirstOrderCostFunction class)

yorkerlin commented 8 years ago

@karlnapf Look at this http://arxiv.org/abs/1509.07164