distillpub / post--visual-exploration-gaussian-processes

A Visual Exploration of Gaussian Processes
http://distill.pub/2019/visual-exploration-gaussian-processes
100 stars 19 forks source link

Final figure not showing all covariance matrices #72

Open loodvn opened 2 years ago

loodvn commented 2 years ago

Hi there

Thanks for a great blogpost! After reading >5 different blogs/resources about GPs, this might be the first time that the multivariate Gaussian <-> points on a plot has made sense to me.

The last plot (combining kernels) is a bit buggy for me: It shows the correct covariance matrix only for combinations when RBF is selected (see Screenshot). With combinations like "only linear" or "periodic + linear", the covariance matrix is blank.

I quickly dug around in the code, but couldn't find anything suspect, except that "this.covMat" was set to different values when the "blank" options (linear/periodic on their own) were selected, but the values were just really small in the covariance matrix.

Also, weirdly, the this.refs.covMat.get().name remains "RBF" no matter what.

Relevant lines: Covariance matrix calculation and disappearance seems to happen here: https://github.com/distillpub/post--visual-exploration-gaussian-processes/blob/master/src/components/KernelCombinations.html#L321

Thanks again!

Screenshot 2022-04-08 at 17 30 24 Screenshot 2022-04-08 at 17 30 10

System: Safari 15.4 (17613.1.17.1.13), Chrome Version 100.0.4896.75 (Official Build) (arm64) MacOS 12.3.1 MacBook Pro 14inch 2021

loodvn commented 2 years ago

Update: After all that, it seems that the covariance matrix for those points is just incredibly faint (probably because it's fitting with so little variance when all those points are there).

Removing some points makes the covariance matrix clearer.

I don't know what the solution is - maybe a note to users would be great (especially if they want to play with it and end up confused like me), or setting the covariance colours a bit darker (or removing one of the points) so that it shows up more clearly even in the default case.

Screenshot 2022-04-08 at 18 12 39