wucy / gptk

Automatically exported from code.google.com/p/gptk
0 stars 0 forks source link

Error in SequentialGP::gradientEvidenceUpperBound (wrong length scales gradient) #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
==Description of the problem==
In SequentialGP, the gradient of the evidence upper bound seems wrong for
the length scale parameter of the Gaussian covariance function.

==How to reproduce the problem==
Run ModelTrainer::checkGradient() with a SequentialGP object.

==What is the expected output? What do you see instead?==
The analytical gradients do not agree with the finite difference estimate
(length scales are wrong - the rest looks fine).

Original issue reported on code.google.com by remi.bar...@gmail.com on 29 Jun 2009 at 11:50

GoogleCodeExporter commented 9 years ago
==Fix==
After writing down the gradient, we should have:

 W = (W-(W + (KB * (C + outer_product(Alpha, Alpha)))) * backslash(KB_new, KB)) *
backslash(KB_new,W);

instead of:

 W = backslash(KB_new, W - (W + (KB * (C + outer_product(Alpha, Alpha)))) * 
backslash(KB_new, KB));

This gives the correct gradient for the length scale. I'm not sure why. What we
compute in the end is the trace of the expressions A*inv(B)*C (works) and 
inv(B)*A*C
(doesn't work). I think both traces should be identical? Maybe it's some 
numerical
issue which depends on the order in which we multiply the matrices?

Original comment by remi.bar...@gmail.com on 29 Jun 2009 at 12:04