New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add covariance factorization caching to gaussian distribution #390
Conversation
compiles, not tested
Note: this is related to #385. |
thanks to rcurtin for the note
I spent far too long benchmarking this trying to track down some anomalously slow results with the new code. I ended up unable to reproduce any slowdown, but hey, I did a good amount of benchmarking, so here are the results. I used this gist: https://gist.github.com/rcurtin/daf960aa6ad545f58402 Below are the numbers for each of the timers in that program (the
So, we get tons of speedup for calls to |
Add covariance factorization caching to gaussian distribution
Add covariance factorization caching to gaussian distribution
These series of commits adds caching of various factorizations and inverses of the covariance matrix for the gaussian distribution. Note that the previous version did not do error checking for positive definite (or even symmetric matrices) on construction-- this is no longer the case (via a cholesky decomposition attempt which fails if the assumption is violated).
In addition, various test cases had to be fixed to make this work. Previous test cases did not even use symmetric covariance matrices in some cases (who knows what the results were actually computing)!