-
Notifications
You must be signed in to change notification settings - Fork 2
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 MvNormalMeanScalePrecision distribution #206
Conversation
ping @Nimrais |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First, great work on implementing the MvNormalMeanScalePrecision distribution and integrating it into the ExponentialFamily.jl.
test/distributions/normal_family/mv_normal_mean_scale_precision_tests.jl
Outdated
Show resolved
Hide resolved
…{MvNormalMeanScalePrecision})
…{MvNormalMeanScalePrecision})
…malMeanScalePrecision})
…recision efficency test fix: remove unneeded code fix: remove not needed stuff fix: remove unused code test: add efficency test fix: return distributions_setuptests to HEAD test(fix): typo test(fix): remove unneeded testset test(fix): update efficency test
3812a9b
to
77f4a0d
Compare
@bvdmitri I think PR is ready for review, but I need some help with efficient implementation of the fisher. The only tests that are failing are once that checking that fisher in this parametrisation is really faster. |
Thanks for refactoring this, @Nimrais! |
test/distributions/normal_family/mv_normal_mean_scale_precision_tests.jl
Outdated
Show resolved
Hide resolved
…n_tests.jl Co-authored-by: Bagaev Dmitry <bvdmitri@gmail.com>
@Nimrais ping, what needs to be done to finish this PR? |
@bvdmitri The basic functionality is now implemented. The only remaining task is to implement the multiplication of the Fisher matrix with another matrix for the Arrowhead matrix structure in BayesBase. Currently, this multiplication is only done in our tests. There's already a generic method for all matrix structures using the getindex method, so implementing this method is the last thing we need to do. |
@bvdmitri basically we need this PR ReactiveBayes/BayesBase.jl#25 be merged to finish this one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to withdraw from reviewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should review your BayesBase dependency. Other than that, the PR looks good to me and I think we can merge.
@@ -28,7 +28,7 @@ TinyHugeNumbers = "783c9a47-75a3-44ac-a16b-f1ab7b3acf04" | |||
|
|||
[compat] | |||
Aqua = "0.8.7" | |||
BayesBase = "1.2" | |||
BayesBase = "1.5.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there stuff in BayesBase
1.5.0 that you need specifically?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, the arrowheadmatrix and the all methods for it to make the CI pass
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work gentlemens
This PR was initially aimed at addressing ReactiveBayes/ReactiveMP.jl#387, which it still does. The distribution in question is parametrized by the mean and scale parameter of the precision matrix.
Initially, I implemented it as part of the
MultivariateNormalDistributionsFamily
. However, the conversions betweenMvNormalMeanScalePrecision
and other distributions in this "class" don't always hold.During the process, @Nimrais suggested that this distribution could be particularly interesting for
ExponentialFamilyProjections.jl
. To make it more useful, we need to optimize methods related to the computation of the Fisher information matrix. I made a first attempt to improve performance by modifying the computation ofkron(invη2, invη2)
. I believe further improvements are possible, but this serves as a starting point.Any suggestions for additional optimizations to enhance the distribution's effectiveness are much welcome.
UPD: I added the piece of code that actually fixes the ReactiveBayes/ReactiveMP.jl#387