Implement Dirichlet and Beta distributions#28
Closed
fritzo wants to merge 24 commits intogamma-reparameterizedfrom
Closed
Implement Dirichlet and Beta distributions#28fritzo wants to merge 24 commits intogamma-reparameterizedfrom
fritzo wants to merge 24 commits intogamma-reparameterizedfrom
Conversation
f74bfac to
9c7694f
Compare
fritzo
commented
Dec 9, 2017
| x = THTensor_(newContiguous)(x); | ||
| alpha = THTensor_(newContiguous)(alpha); | ||
| total = THTensor_(newContiguous)(total); | ||
| // FIXME these lines cause a linker error: |
Author
There was a problem hiding this comment.
@apaszke Any idea why these macros would cause a linker error? They were fine before I moved to THTensorMath.c.
There was a problem hiding this comment.
Hard to say. For some reason the macro doesn't seem to be defined in this point, so it gets treated as an implicit declaration of a function (you're probably getting some warnings for this)
* Ensure RNNCell variants don't broadcast * Fix lint * Add test for hidden_size=1 in RNNCell no broadcasting test * Prevent broadcasting for hidden_size and input_size * Isolate input checking from hidden size checking
Author
|
Moved to pytorch#4117 |
fritzo
pushed a commit
that referenced
this pull request
Jan 30, 2019
Summary: Pull Request resolved: pytorch/FBGEMM#28 Pull Request resolved: pytorch#14516 This is the first diff in a series of diffs that will separate out avx2 specific code in separate files. The goal is to compile as little as possible code with avx2 and avx512 compiler flags. Reviewed By: jianyuh Differential Revision: D13248376 fbshipit-source-id: 401c2e9d3cd96c420fd08c3efa011febce96ffbb
This file contains hidden or 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
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.
Based on pytorch#3978
DO NOT MERGE This PR will be moved to pytorch/pytorch.
This Implements reparameterized
DirichletandBetadistributions with zero-variance gradients. The samplers useGamma.sample()and the reparameterized gradients are computed with similar numerical approximations. The approximation currently has bias under 2.5% relative error for a wide range of parameters (and rms relative error well below 0.5%); while this is above machine tolerance, it is much lower error than the high-variance stochastic version based onGamma.sample().For details of the derivation, see this Jupyter Notebook.
Accuracy of this zero-variance version
Details
Accuracy of older stochastic version
Details