Skip to content
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

Implement AutoHierarchicalNormalMessenger #2955

Merged
merged 46 commits into from
Nov 5, 2021
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
84feca4
Implement Effect_ELBO and AutoRegressiveMessenger
fritzo Oct 28, 2021
afe472c
Fix max_plate_nesting typo
fritzo Oct 28, 2021
75a0a6f
Add docs
fritzo Oct 28, 2021
b656276
Get smoke tests passing
fritzo Oct 28, 2021
6c29e1b
Fix tests
fritzo Oct 28, 2021
2993402
Add AutoNormalMessenger
fritzo Oct 29, 2021
6eb02e4
Add example to docstring
fritzo Oct 29, 2021
84d5e60
Support calling guide(*args, **kwargs)
fritzo Oct 30, 2021
3d5250e
Support init_loc_fn, init_scale
fritzo Oct 30, 2021
0ac9ae1
Add more tests
fritzo Oct 30, 2021
0637e00
Fix jit tests
fritzo Oct 30, 2021
bb092a9
Add more docs
fritzo Oct 30, 2021
bc889e4
Revert unnecessary change
fritzo Oct 30, 2021
4a473fb
draft AutoHierarchicalNormalMessenger
vitkl Oct 30, 2021
a564f5f
added hierarchical loc and hierarchical_sites list
vitkl Oct 30, 2021
56d26af
Document relationship to AutoNormal
fritzo Oct 30, 2021
5fe690a
updated docs, added initialisation for hierarchal sites
vitkl Oct 30, 2021
65c9c3e
renamed class and added rst
vitkl Oct 30, 2021
5683f70
added to autoguide module
vitkl Oct 30, 2021
a9cc1cd
bug fixes
vitkl Oct 31, 2021
bd6b69e
added tests for AutoHierarchicalNormal
vitkl Oct 31, 2021
5db1006
fixed isort
vitkl Oct 31, 2021
9759577
fixed docs error
vitkl Oct 31, 2021
598dca8
added transform.inv(prior.mean) to initialisation
vitkl Oct 31, 2021
26bd9bf
Support subsampling and amortization
fritzo Oct 31, 2021
8556734
lint
fritzo Oct 31, 2021
7715687
Remove debug statement
fritzo Oct 31, 2021
4ea9288
rename AutoHierarchicalNormalMessenger
vitkl Nov 1, 2021
3407c64
element-wise weight;
vitkl Nov 1, 2021
884c435
updated tests
vitkl Nov 1, 2021
da01b98
fixed lint
vitkl Nov 1, 2021
cf41ae6
fixed docs
vitkl Nov 1, 2021
5c3e5bc
Add a poutine.unwrap() helper function
fritzo Nov 1, 2021
f03401a
Eliminate Effect_ELBO and mixin stuff
fritzo Nov 1, 2021
8749c96
Fix docs
fritzo Nov 1, 2021
c161ebb
Revert unnecessary change
fritzo Nov 1, 2021
872b82d
Fix poutine.unwrap()
fritzo Nov 1, 2021
26b443d
merge latest messenger guides;
vitkl Nov 1, 2021
06cc3eb
merge dev
vitkl Nov 1, 2021
96eb005
resolved more conflicts
vitkl Nov 1, 2021
e4fd8af
updated hierarchical guide with latest changes
vitkl Nov 1, 2021
f25365f
fixed lint
vitkl Nov 1, 2021
a3e8d07
fixed isort
vitkl Nov 1, 2021
f48ba6b
updated tests and docs
vitkl Nov 3, 2021
8db479f
changes to initialisation and docs
vitkl Nov 4, 2021
06c6354
fixed initialisation
vitkl Nov 4, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions docs/source/infer.autoguide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,30 @@ AutoGaussian
:member-order: bysource
:show-inheritance:

AutoMessenger
-------------
.. autoclass:: pyro.infer.autoguide.AutoMessenger
:members:
:undoc-members:
:member-order: bysource
:show-inheritance:

AutoNormalMessenger
-------------------
.. autoclass:: pyro.infer.autoguide.AutoNormalMessenger
:members:
:undoc-members:
:member-order: bysource
:show-inheritance:

AutoRegressiveMessenger
-----------------------
.. autoclass:: pyro.infer.autoguide.AutoRegressiveMessenger
:members:
:undoc-members:
:member-order: bysource
:show-inheritance:

.. _autoguide-initialization:

Initialization
Expand Down
7 changes: 7 additions & 0 deletions docs/source/inference_algos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ ELBO
:show-inheritance:
:member-order: bysource

.. automodule:: pyro.infer.effect_elbo
:members:
:undoc-members:
:special-members: __call__
:show-inheritance:
:member-order: bysource

Importance
----------

Expand Down
16 changes: 10 additions & 6 deletions pyro/infer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from pyro.infer.abstract_infer import EmpiricalMarginal, TracePosterior, TracePredictive
from pyro.infer.csis import CSIS
from pyro.infer.discrete import infer_discrete
from pyro.infer.effect_elbo import Effect_ELBO, GuideMessenger, JitEffect_ELBO
from pyro.infer.elbo import ELBO
from pyro.infer.energy_distance import EnergyDistance
from pyro.infer.enum import config_enumerate
Expand All @@ -27,17 +28,16 @@
from pyro.infer.util import enable_validation, is_validation_enabled

__all__ = [
"config_enumerate",
"CSIS",
"enable_validation",
"is_validation_enabled",
"ELBO",
"Effect_ELBO",
"EmpiricalMarginal",
"EnergyDistance",
"GuideMessenger",
"HMC",
"Importance",
"IMQSteinKernel",
"infer_discrete",
"Importance",
"JitEffect_ELBO",
"JitTraceEnum_ELBO",
"JitTraceGraph_ELBO",
"JitTraceMeanField_ELBO",
Expand All @@ -51,13 +51,17 @@
"SMCFilter",
"SVGD",
"SVI",
"TraceTMC_ELBO",
"TraceEnum_ELBO",
"TraceGraph_ELBO",
"TraceMeanField_ELBO",
"TracePosterior",
"TracePredictive",
"TraceTMC_ELBO",
"TraceTailAdaptive_ELBO",
"Trace_ELBO",
"Trace_MMD",
"config_enumerate",
"enable_validation",
"infer_discrete",
"is_validation_enabled",
]
8 changes: 8 additions & 0 deletions pyro/infer/autoguide/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0

from pyro.infer.autoguide.effect import (
AutoMessenger,
AutoNormalMessenger,
AutoRegressiveMessenger,
)
from pyro.infer.autoguide.gaussian import AutoGaussian
from pyro.infer.autoguide.guides import (
AutoCallable,
Expand Down Expand Up @@ -41,9 +46,12 @@
"AutoIAFNormal",
"AutoLaplaceApproximation",
"AutoLowRankMultivariateNormal",
"AutoMessenger",
"AutoMultivariateNormal",
"AutoNormal",
"AutoNormalMessenger",
"AutoNormalizingFlow",
"AutoRegressiveMessenger",
"AutoStructured",
"init_to_feasible",
"init_to_generated",
Expand Down
Loading