-
Notifications
You must be signed in to change notification settings - Fork 4
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
Support pr inference in differentiable computation graph #170
Closed
Conversation
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
rtjoa
changed the title
Support log probabilities in differentiable computation graph
Support probabilities in differentiable computation graph
Dec 23, 2023
This reverts commit b679333.
rtjoa
changed the title
Support probabilities in differentiable computation graph
Support pr inference in differentiable computation graph
Dec 27, 2023
Update QC infra
…ce.jl into qc7.5-approx-entropy
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
We update autodiff to represent the log probabilities of
Dist{Bools}
s symbolically, to train arbitrary loss functions instead of just doing MLE.In fact, we support "arbitrary interleavings" - computation dependent on log probabilities can be used as flip parameters, to create more symbolic log probabilities, etc.
We also refactor to shrink the interface where possible, clean up BDD differentiation, and add autodiff support for matrices and trig functions.
Main API changes
The core construct we add is the struct
LogPr(::Dist{Bool}) <: ADNode
.LogPr
, usecompute_mixed
rather thancompute
.Dist
containing a flip whose probability is dependent on aLogPr
, usepr_mixed
rather thanpr
.train!(::Valuation, loss::ADNode; epochs, learning_rate)
updates a valuation (dict fromVar
s to values) to minimize loss by GDWe also add basic loss functions,
mle_loss
andkl_divergence
.Tests
New tests are added to
test/autodiff_pr
.