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

Use provenance tracking to compute downstream costs in TraceGraph_ELBO #3081

Merged
merged 9 commits into from May 31, 2022

Conversation

ordabayevy
Copy link
Member

This proposes to use ProvenanceTensor to track cost terms influenced by each non-reparameterizable sample site. It simplifies the code and in theory should have a more fine-grained Rao-Blackwellization.

@martinjankowiak
Copy link
Collaborator

@ordabayevy cool! i think you need to update the docstring to reflect the (potentially) finer level of dependency tracking

@martinjankowiak
Copy link
Collaborator

you should probably run some of the tests that are currently skipped in tests/integration_tests/test_conjugate_gaussian_models.py on your local machine

@ordabayevy
Copy link
Member Author

Tests pass on the local machine:

$ pytest test_conjugate_gaussian_models.py
=========================== test session starts ===========================
platform linux -- Python 3.8.12, pytest-7.1.1, pluggy-1.0.0
benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /home/ordabayev/repos/pyro, configfile: setup.cfg
plugins: xdist-2.5.0, benchmark-3.4.1, forked-1.4.0, nbval-0.9.6
collected 12 items

test_conjugate_gaussian_models.py ............                      [100%]

===================== 12 passed in 799.56s (0:13:19) ======================

@ordabayevy
Copy link
Member Author

I'm happy to go through the PR code with anyone interested in reviewing it 😄

@fehiepsi
Copy link
Member

I'm interested in. Thanks Yerdos!

@ordabayevy
Copy link
Member Author

Awesome @fehiepsi ! Do you want to set up a Zoom meeting for Friday or Saturday?

@fehiepsi
Copy link
Member

LGTM! Could you also run the attend, infer, and repeat example to see if we still get desirable result?

@ordabayevy
Copy link
Member Author

ordabayevy commented May 31, 2022

I ran the air.py example using the new TraceGraph_ELBO and got 99.1% accuracy. Parameters used are the same as from the example:

python main.py -n 200000 -blr 0.1 --z-pres-prior 0.01 --scale-prior-sd 0.2 --predict-net 200 --bl-predict-net 200 --decoder-output-use-sigmoid --decoder-output-bias -2 --seed 287710

Graphs below show ELBO and Accuracy for the new (orange) and old (blue; not finished) TraceGraph_ELBO. They overlap very closely.

ELBO
elbo

Accuracy
acc

@ordabayevy ordabayevy requested a review from fehiepsi May 31, 2022 13:36
Copy link
Member

@fehiepsi fehiepsi left a comment

Choose a reason for hiding this comment

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

Thanks Yerdos! This is really nice.

@ordabayevy
Copy link
Member Author

Thanks for reviewing @fehiepsi !

@fehiepsi fehiepsi merged commit 2b653e0 into dev May 31, 2022
@ordabayevy ordabayevy deleted the provenance-graph-elbo branch May 31, 2022 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants