-
Notifications
You must be signed in to change notification settings - Fork 85
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
Variational inference #494
Merged
+2,185
−423
Merged
Changes from 246 commits
Commits
Show all changes
253 commits
Select commit
Hold shift + click to select a range
c8cf275
Fix broken syntax.
null-a 55dfa66
add daipp package
ngoodman 8a320fb
clean up daipp library a little
ngoodman 9c42102
Merge branch 'daipp' of https://github.com/probmods/webppl into daipp
ngoodman bfb6e31
Re-work relative addressing.
null-a 6f697af
Complain if example trace includes AD nodes.
null-a 92baef1
First pass at bringing DAIPP closer to executable state.
dritchie 705d5e3
Correctly untapify tensor params at sample stmts.
null-a 4e6e286
small edits in daip.js
ngoodman d873f38
merge
ngoodman edd7351
clean up daip.js, add cache fn
ngoodman cbca136
handle empty array in val2vec
ngoodman 33c7c94
add (probably wrong) squishnet for get right range in erp params
ngoodman 0601c34
maybe fix tensor stuff in squishnet
ngoodman 0b213be
make latentSize live in daipp js, provided as daipp.latentSize
ngoodman 424ed1a
change vec2importanceERP to vec2dist, because it sounds nice
ngoodman c9e1ee0
clean things up a bit
ngoodman b74a705
More work on getting DAIPP ready to go (also some comments/questions)
dritchie a924a87
Merge branch 'dev' into daipp
null-a 543b7de
Remove unused var.
null-a 360e78a
Remove unused code.
null-a 368066e
Add TODO note.
null-a a725688
Re-work parameter registration.
null-a 0af45e9
added comment re address vectors
ngoodman ee822ba
add sketch of minimal daipp example, started fixing bugs
ngoodman 7c80c1a
make daipp package name lowercase
ngoodman 27a9e9c
Bind callback context.
null-a 58538ef
tensorAdaptor takes length as first arg not array.
null-a b88166c
Fix typo in variable name.
null-a 88141cf
Fix indentation.
null-a 5104bdb
Need to test for undefined in strict eq test.
null-a d62acc4
Simplify Gaussian guide to get things running.
null-a 3646090
Extract scalars from singleton tensors.
null-a 0fe2f7d
Remove debug logging.
null-a 5eef5ff
Fix order of args to score.
null-a 7695325
Reduce stepSize for stability.
null-a 1a9b427
Tweak output to get a sense of what's happening.
null-a 9aac452
Throw error on unhandled ERP type.
null-a 18047ea
Make it clearer the cases are mutually exclusive.
null-a d7de7c1
Prefer strict equality tests.
null-a fd92b83
Make adagrad work with most recent param storage.
null-a 8b4f1fc
Add note.
null-a 9391f40
Update adnn dependency.
null-a 3f5d8fd
Merge branch 'dev' into daipp
null-a 9cfac4a
Add SampleGuide coroutine.
null-a 9c0002a
Test output of daipp 'hello world'.
null-a 39a9966
Add file missed from last commit.
null-a e73f246
Warn if gradients are zero.
null-a c3b194a
Enable training of embedding nets.
null-a 3e454ad
Add Note.
null-a 6915e1e
Handle lifted numbers/tensors in val2vec.
null-a 8553138
Fix bug in parameter registration.
null-a 4035e3e
Add basic daipp testing infrastructure.
null-a 7212c0e
Rename daipp test runner.
null-a 59555dd
Bump adnn dependency version.
dritchie 2e1941e
Made reshape net work with most recent adnn update.
dritchie 89ce131
Add daipp test case.
null-a 9373f23
Make SMC+rejuv work for guided programs.
null-a d0f4746
Support mini-batches in EUBO.
null-a 46400d4
Add daipp test case.
null-a feaeb23
Clean-up daipp test cases.
null-a 06cf81e
Re-work registerParams.
null-a f1022ff
Add note.
null-a 31a8fc8
add sampleDaipp helper
ngoodman 4bdd0c5
add simple qmr like example, fix typo in sampleDaipp helper.
ngoodman 453747e
soften factor in simpleqmr example. add note.
ngoodman 0d95e45
Log warning if gradients are not finite.
null-a 75a725f
Only issue gradient warnings once per param.
null-a c3034a9
Add debug option to Optimize.
null-a f960cce
Fix daipp qmr example.
null-a 77cf62e
Re-jig optimization method interface.
null-a 8f392f1
Rename vars for consistency.
null-a d1ae98f
Fix rmsprop & adam.
null-a 3953707
Remove unused method.
null-a ef19392
Tweak param cloning in SMC.
null-a 5dd9f6b
Bump adnn version.
dritchie 0a70a7f
Add notes.
null-a 54f4d00
Use logGamma AD primitive.
null-a b477b4d
Remove tensor reshape, now implemented in adnn.
null-a 58ec196
Update comment.
null-a cb996f7
Support diagCovGaussianERP in DAIPPguide.
null-a c14e3bf
Add linear regression daipp example.
null-a dc4122e
add commented out line for testing
ngoodman 4c17034
Merge branch 'daipp' of https://github.com/probmods/webppl into daipp
ngoodman 2ebd017
Use soft-plus instead of exp for one-sided bounds.
dritchie 3cfbbea
merge
ngoodman 762f305
Sketch of model structure.
null-a c0543bc
Merge branch 'daipp' of https://github.com/probmods/webppl into daipp
ngoodman 89091fc
revise wakey sleepey sketch
ngoodman f7124cc
Show progress in Optimize.
null-a b93bb18
Initial implementation of mapData.
null-a cd69545
Re-work mapData.
null-a 8479339
Option to persist mini-batches across optim steps.
null-a b72fa9e
Quick hack to save ELBO progress to disk.
null-a 23c711d
Initial attempt at evaluating guides.
null-a 9fa6b86
Make logistic faster by using ad.tensor.softmax
dritchie c2b248e
DAIPP guide for dirichlet distributions.
dritchie 63e59ae
Basic DAIPP LDA example. Runs, but doesn't optimize very well (yet)
dritchie cb514e4
Tweak forEach in lda example.
null-a 9ab9024
Update context as described in structure.wppl.
null-a 525695d
Increase stepSize in lda example.
null-a 2a2f75c
Reinstate previous coroutine before exiting.
null-a 0715c7f
Re-write EvaluateGuide.
null-a 39d0ecf
Simple model for EvaluateGuide sanity check.
null-a b845f2a
trying to find where the nans come from...
ngoodman b92be72
Merge branch 'daipp' of https://github.com/probmods/webppl into daipp
ngoodman d99a302
Fix logic in ELBO mini-batch handling.
null-a 07aaa5b
comment out some asserts that were problematic
ngoodman fc93889
Fix assertions.
null-a e22ae38
Fix bug in mapData stack addresses.
null-a ddc9f7d
switch daipp back to tanh
ngoodman 5cdd0c9
Add mean-field guide to lda example.
null-a 60a1531
make evaluateGuide allow multiple data indices
ngoodman 7783c38
make evaluateGuide allow multiple data indices
ngoodman f33a34f
Bump adnn version.
dritchie 97e4412
Bump adnn version.
dritchie 85a31cd
Bump adnn version.
dritchie 1fc4df9
Remove tensor ops that are now in adnn.
null-a d2fd145
Tweak output of daipp 'tests'.
null-a f534dbe
Use adnn debug checks.
null-a b6b6849
Remove overridden inspect.
null-a ca58f7f
Check for NaN in ELBO objective.
null-a 5108f28
Bump adnn version.
dritchie 54d2061
Merge branch 'daipp' of https://github.com/probmods/webppl into daipp
ngoodman 478ebe8
adding simpler example and some documentation of the bayesnets expts
ngoodman 3434c92
Bump adnn version.
dritchie c9dd982
Merge branch 'daipp' of github.com:probmods/webppl into daipp
dritchie 9c9f7a2
Lint.
null-a 7b43519
Set defaults for debug/verbose opts in estimators.
null-a 2bf09a0
Better estimator when not doing any reparam.
null-a c75ac1c
Remove out-of-date usage examples.
null-a 76f9a22
Remove out-of-date comment.
null-a 241425b
Init. tensor params with draws from Gaussian.
null-a 9fd9f3e
Add basic VAE example.
null-a 2839fed
fix mapData to return something
ngoodman 0d8674b
Lint.
null-a 07cff0b
Remove unused helper.
null-a ba74a3c
Merge branch 'dev' into daipp
null-a c288a91
Minor tweak to LDA example.
null-a 0528887
Init. with normalized vector rather than array.
null-a 941001f
Add momentum option to gradient descent.
null-a 59ac3bd
Add AIR sketch.
null-a 277d14a
Update AIR commentary.
null-a 74debb8
Use 'Xavier initialization' for guide nets.
null-a b94abf0
Merge branch 'dev' into daipp
null-a 3171f47
Use 'distribution' rather than 'ERP' in daipp.
null-a 9ad58c5
Merge branch 'dev' into daipp
null-a 2abd605
Update distribution docs.
null-a e50d501
Prefer strict equality checks.
null-a b049000
Add TODO note.
null-a 5bc11c0
Rename MultivariateBernoulli param p => ps.
null-a 16d4b8f
Add compound nets for recurrent units.
null-a d969459
Add gradient clipping.
null-a e2393ac
Add more daipp examples.
null-a 45ab64b
Use RU constructor for update and predict nets.
null-a 4df8cca
Use RU constructor for array RNN.
null-a 3379c79
Remove figure.
null-a 4b881a5
Merge branch 'dev' into daipp
stuhlmueller 3c022c5
mapData no longer breaks reparam detection.
null-a 659e679
Represent all guide params as tensors internally.
null-a 1ae5651
Use addr. relative to mapData at update/predict.
null-a b06e145
Have getRelativeAddress not be a method on env.
null-a 278dfb3
Simplify choice look-up in EUBO.
null-a 51588e9
Make daipp.js a wppl header.
null-a 18505ea
Avoid exposing a global JS function.
null-a 9054e59
Improve tensor handling in ad.valueRec.
null-a 32d7577
Remove stale comment.
null-a a584ec4
Clean-up helper.
null-a 112ee3a
Improve fn name, update commentary.
null-a 920bd2a
Make EUBO work with SMC + HMC rejuv.
null-a 1a8a188
Remove experimental context arg from cpsLoop.
null-a 258bea8
Clean-up ops on the parameter grad data structure.
null-a 5445620
Fix bug in gradient clipping.
null-a 5b0f98d
Switch to adnn optimization methods.
null-a 7ec8c9b
Return guide parameters from SMC.
null-a 987d011
Extract fns for copying parameter data structure.
null-a 2bbf8d8
Update tensors in-place.
null-a 09c2d46
Rename paramgrad to paramStruct.
null-a 6eb1a89
Fix edge cases in mv Bernoulli scorer.
null-a 65f3bec
Move comment to docs.
null-a 4f973cf
Add arg check helpers.
null-a d2ee870
Generalize and clean-up MatrixGaussian dist.
null-a 37f70f3
Use more efficient TensorGaussian as reparam base.
null-a 0b6c88c
Clean-up DiagCovGaussian distribution.
null-a a1d5a95
Remove stale code.
null-a c6d6c87
Clean-up MultivariateGaussian distribution.
null-a 4da8b85
Remove DiscreteOneHot distribution.
null-a 1f44d37
Merge branch 'dev' into daipp
null-a d3f14b3
Use TensorGaussian for VAE prior.
null-a 77553e2
Version of VAE with priors on generative params.
null-a 2ff1d7c
Have Discrete accept vector or array of probs.
null-a 02f2b32
Update adnn dependency.
null-a 14fb714
Combine util.isObject and dists.isParams.
null-a ada5dd7
Update the lda example to work with vectors.
null-a 685883a
Clean-up Dirichlet.
null-a 0d052f4
Update DirichletDrift in line with Dirichlet.
null-a ea9f466
Update mv regression example to work with vectors.
null-a 7808c3f
Remove unused dependency.
null-a e9ad4f7
Fix util.isObject on Node <= 0.12
null-a c393f5a
Merge branch 'dev' into daipp
null-a 91647fb
Clean-up LogisticNormal.
null-a 9362e25
Tweak initialization of net bias vectors.
null-a 3befd95
Removed old importance distribution helper.
null-a 8c3f0e6
Move helper function to util.
null-a c8b18ba
Generalize sampleGuide to also sample from target.
null-a ad2e936
Add basic tests for VI.
null-a c1d10b8
Handle guides programs with zero params in elbo.
null-a 49723e7
Fix Node <= 0.12 compatibility.
null-a a1fc4d9
Switch default optimization method to adagrad.
null-a 2e346b3
Test all inference methods against guided program.
null-a b85c0e7
Typo.
null-a c468776
Default to mean-field guide in elbo/forwardSample.
null-a 470f730
Add domain info for more distribution parameters.
null-a 2f79ca5
Include parameter domains in distribution docs.
null-a a3f1837
Merge branch 'dev' into daipp
null-a f2ac87e
Soften condition in withCaching test.
null-a 5e015b3
Add more optimize+elbo tests.
null-a cd0eff2
Add smoke tests for multivariate distributions.
null-a c32a3a5
Tweak Infer interface to optimization.
null-a 26cfd42
Only show mean-field params msg in verbose mode.
null-a 5c59f3a
Lint.
null-a c9a9d4c
Remove daipp.
null-a 7a68b7c
Hack to get daipp working as a package.
null-a 6171518
Merge branch 'dev' into daipp
null-a c789778
Extract domain helpers to separate file.
null-a c6410a9
Guide Dirichlet with LogisticNormal.
null-a 4ca9ae3
Add missing 'use strict' directives.
null-a 7c24e15
Basic tests for DiagCovGaussian & TensorGaussian.
null-a 354ff47
Make daipp work without introducing new global.
null-a 20ca180
Add basic docs for optimize/guides/params.
null-a 1c09fe4
Clean-up TODO notes in preparation to merge.
null-a d23ea88
Add dedicated option for gradient checking.
null-a 6f56447
Refactor mean-field guides.
null-a e881e23
Remove unused imports.
null-a 5831d3e
Suppress noise in inference test output.
null-a 05d0c64
Remove stale comments.
null-a a63d48d
Improve commentary.
null-a 96a4d51
Move guide evaluation in to the daipp pkg.
null-a 31ce98a
Avoid confusing the sample and forceSample params.
null-a 3538227
Bump up the number samples following CI failures.
null-a 316c775
Revert "Bump up the number samples following CI failures."
null-a 7575762
Undo unintentional change made to inference test.
null-a 224b9ce
Remove stale comment.
null-a 5f27be8
Move helpers to util module.
null-a 5780a3d
Remove unused imports.
null-a 6b16f41
Merge branch 'dev' into daipp
null-a af40024
Don't rely on macros to transform Math.logGamma
null-a 88071db
Document the optMethod parameter.
null-a 5c73a71
Remove mapData.
null-a 1ed8082
Move special.js and statistics.js to math folder.
null-a File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
.. _guides: | ||
|
||
Guides | ||
====== | ||
|
||
Creating parameters | ||
------------------- | ||
|
||
.. js:function:: scalarParam(mean, sd) | ||
|
||
:param real mean: mean (optional) | ||
:param number sd: standard deviation (optional) | ||
|
||
Creates a new scalar valued parameter initialized with a draw from | ||
a Gaussian distribution. | ||
|
||
If ``sd`` is omitted the initial value is ``mean``. If ``mean`` is | ||
omitted it defaults to zero. | ||
|
||
Example:: | ||
|
||
scalarParam(0, 1) | ||
|
||
.. js:function:: tensorParam(dims, mean, sd) | ||
|
||
:param array dims: dimension of tensor | ||
:param number mu: mean (optional) | ||
:param number sd: standard deviation (optional) | ||
|
||
Creates a new tensor valued parameter. Each element is initialized | ||
with an independent draw from a Gaussian distribution. | ||
|
||
If ``sd`` is omitted the initial value of each element is ``mean``. | ||
If ``mean`` is omitted it defaults to zero. | ||
|
||
Example:: | ||
|
||
tensorParam([10, 10], 0, 0.01) | ||
|
||
.. js:function:: param(arg1, arg2, arg3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,8 @@ Contents: | |
usage | ||
inference | ||
distributions | ||
guides | ||
tensors | ||
debugging | ||
packages | ||
development/index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Describe
optMethod
option (if it's applicable here)?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.
Done!