shogun-toolbox/shogun — pull request #638 by puffin444 (2012-07-11 01:25:31+00:00)
Title: Sum and Product Gradients

After 2 excruciatingly long weeks, I finally have the code ready for sum and product kernel gradients. Also included is some support for float64_t and int32_t vectors/sgvectors in the model gradient selection framework. I did not use this code for the final implementation however, but I left it in if may prove useful for other tasks. Beware though, as I have not tested the vector code thoroughly. I can remove it if you wish. Instead I found that it was easier to expose some of the parameters in CList as model selection parameters. This approach works very well, but it think it may be improved. Right now it is somewhat cumbersome to build the initial parameter tree in the examples. There are now hyperparameter learning examples for gaussian, product, and sum kernels. The gaussian and product kernels give me very close answers to that of GPML. The sum kernel seems to depend a lot on the initial parameters.

1. Whats the appropriate way to allocate something on the heap in shogun? I have been using
new. Should I use SG_MALLOC instead?
2. I used a template for set_parameter in parameter combination to easy the plethora of functions based on different types. Is this appropriate?
3. I had to change some things around in ExactInferenceMethod/InferenceMethod for it to handle CombinedFeatures as will as DotFeatures. Right now it assumes that all the subfeatures in the CombinedFeatures object are the same. Should I include a check to make sure that this is the case?
4. I think the product kernel gradient calculation may benefit from some speedup via threading. What do you think?