Fix 2948#2949
Merged
junpenglao merged 4 commits intopymc-devs:masterfrom Apr 24, 2018
junpenglao:fix#2948
Merged
Conversation
added 2 commits
April 23, 2018 21:44
Contributor
Member
Author
|
This will not effect the fix for #2482. |
Member
Author
|
So far this is really weird... ndim = 3
with pm.Model() as model:
sigma = pm.Lognormal('sigma',
mu=np.zeros(ndim),
tau=np.ones(ndim),
shape=ndim) # variance for the correlation matrix
nu = pm.HalfCauchy('nu', beta=10)
factors = [var.logpt for var in model.basic_RVs] + model.potentials
logp = tt.sum([tt.sum(logpt) for logpt in factors]) --> fail
logp = tt.add(*map(tt.sum, factors)) --> works
func = pm.model.ValueGradFunction(logp, model.basic_RVs)
func.set_extra_values(model.test_point)
q = np.array([2.30258509, 1., 1., 1.])
func(q)And the error only appears using Lognormal when the tau or sd is multi dimensional... |
added 2 commits
April 23, 2018 22:38
Member
Author
|
I will merge this if no more comment. |
Member
|
LGTM, though the previous code also looked good. Glad you added some tests! |
Member
|
Possible performance hit from this change? http://pandas.pydata.org/speed/pymc3/#benchmarks.NUTSInitSuite.track_glm_hierarchical_ess |
Member
Author
|
Thanks for the heads up. I am a bit surprised that it effected the effective sample size - will report back. |
ColCarroll
pushed a commit
that referenced
this pull request
May 7, 2018
* Optimized logpt computation I change the logpt computation in #2949 to fix #2948, however, it slows down the speed as some graph optimization is turned off (those optimization is originally cause the error in #2948). I am trying with a differen approach here. @ColCarroll * fix test
agustinaarroyuelo
pushed a commit
to agustinaarroyuelo/pymc3
that referenced
this pull request
Feb 8, 2019
* Fix 2948 Reverse the logpt tensor computation back to pre pymc-devs#2499. close pymc-devs#2948 * fix mistake * add test interestingly, we can pick up the error using `func = ValueGradFunction(m.logpt, m.basic_RVs)` but not `func = ValueGradFunction(m.logpt, m.basic_RVs, mode='FAST_COMPILE')` * fix test for float32
agustinaarroyuelo
pushed a commit
to agustinaarroyuelo/pymc3
that referenced
this pull request
Feb 8, 2019
* Optimized logpt computation I change the logpt computation in pymc-devs#2949 to fix pymc-devs#2948, however, it slows down the speed as some graph optimization is turned off (those optimization is originally cause the error in pymc-devs#2948). I am trying with a differen approach here. @ColCarroll * fix test
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.
Reverse the logpt tensor computation back to pre #2499.
close #2948