Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

[WIP] The draft implementation of the new execution time distributions. #168

Draft
wants to merge 16 commits into
base: develop
Choose a base branch
from

Conversation

zhenwendai
Copy link
Contributor

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

The current type of distribution class in MXFusion is a "symbolic" notation for probabilistic model and variational posterior definition. When developing sophisticated inference algorithm, one often faces the need of creating some intermediate distribution objects that do not exist in model/posterior definition. In the implementation of current inference algorithms, those distributions are explicitly represented in terms of their parameters. This is not ideal for memory organization and code reusing. If there are distribution objects for execution, those intermediate distributions can be better organization in an object-oriented fashion. Many distribution computation functions can be implemented on top of those execution time distribution classes such as Kullback-Leiber divergence. A good example of such distribution classes is the distribution class in Tensorflow (tf.distrbution).

## Proposed Changes

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will you add a section here on how the proposed changes affect the existing Distribution classes? Also on how this will or could extend to encompass functions as well? We probably want to strive to keep the two Factors consistent when it comes to things like where runtime vs graphical code lives.

Add multivariate normal run time distribution
* restructure the folders by renaming mxfusion.components.dist_impl to mxfusion.runtime.distributions

* The remaining adjustment

* Extend multivariate normal with general broadcasting.

* Update the naming of runtime distributions.

* Remove unnecessary comments.

* Temporally fix the test case failure.

* Rename RunTime to Runtime.
@codecov-io
Copy link

codecov-io commented May 14, 2019

Codecov Report

Merging #168 into develop will decrease coverage by 0.85%.
The diff coverage is 74.02%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #168      +/-   ##
===========================================
- Coverage    88.14%   87.28%   -0.86%     
===========================================
  Files           80       87       +7     
  Lines         4057     4208     +151     
  Branches       691      704      +13     
===========================================
+ Hits          3576     3673      +97     
- Misses         307      358      +51     
- Partials       174      177       +3
Impacted Files Coverage Δ
mxfusion/components/distributions/random_gen.py 76.11% <0%> (-2.99%) ⬇️
...sion/components/distributions/sigmoid_bernoulli.py 0% <0%> (ø)
mxfusion/components/distributions/bernoulli.py 69.23% <100%> (-22.44%) ⬇️
mxfusion/runtime/distributions/bernoulli.py 100% <100%> (ø)
mxfusion/components/variables/runtime_variable.py 100% <100%> (ø) ⬆️
mxfusion/components/distributions/normal.py 90.59% <100%> (-5.93%) ⬇️
mxfusion/runtime/distributions/__init__.py 100% <100%> (ø)
...xfusion/runtime/distributions/sigmoid_bernoulli.py 50% <50%> (ø)
mxfusion/runtime/distributions/distribution.py 60% <60%> (ø)
...usion/runtime/distributions/multivariate_normal.py 83.33% <83.33%> (ø)
... and 13 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 94f63dc...78c8c88. Read the comment docs.

Zhenwen Dai and others added 10 commits June 14, 2019 17:07
…distribution except GPs (#182)

* restructure the folders by renaming mxfusion.components.dist_impl to mxfusion.runtime.distributions

* The remaining adjustment

* Extend multivariate normal with general broadcasting.

* Update the naming of runtime distributions.

* Remove unnecessary comments.

* Temporally fix the test case failure.

* Rename RunTime to Runtime.

* bring in the changes from develop

* Implement the runtime distribution for beta and gamma.

* The changes for svgp regression.

* Implement Bernoulli distribution

* Implement Categorical.

* Implement Sigmoid Bernoulli distribution.

* Add back the testcase for Beta distribution.

* Implement Laplace runtime distribution.

* Implement the Dirichlet runtime distribution.

* Implemented Wishart distribution.

* Implement the pointmass runtime distribution.

* Add the point mass runtime distribution file.

* Updated the interface for normal distributions.

* Modify the multivariate normal distribution.

* Implement Multivariate normal with mean and precision.

* Update test requirements.

* Update test requirements.

* bug fix for svgpregression module.

* Fix the error in the docstring.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants