-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Fixes the difference b/w logpt and logp_nojac #3398
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -269,7 +269,9 @@ def logpt(self): | |||||||||
|
|
||||||||||
| @property | ||||||||||
| def logp_nojact(self): | ||||||||||
| """Theano scalar of log-probability, excluding jacobian terms.""" | ||||||||||
| """Theano scalar of log-probability of the model but without the jacobian | ||||||||||
| if transformed Random Variable is presented. | ||||||||||
| """ | ||||||||||
| if getattr(self, 'total_size', None) is not None: | ||||||||||
| logp = tt.sum(self.logp_nojac_unscaledt) * self.scaling | ||||||||||
| else: | ||||||||||
|
|
@@ -734,7 +736,9 @@ def logpt(self): | |||||||||
|
|
||||||||||
| @property | ||||||||||
| def logp_nojact(self): | ||||||||||
| """Theano scalar of log-probability of the model""" | ||||||||||
| """Theano scalar of log-probability of the model but without the jacobian | ||||||||||
| if transformed Random Variable is presented. | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this mean that the Jacobian will be present if there are no transformed random variables? That is how I understand the sentence.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If there are no transformed variables there is no need for Jacobian correction, hence logp_nojact will be the same as logpt
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
| """ | ||||||||||
| with self: | ||||||||||
| factors = [var.logp_nojact for var in self.basic_RVs] + self.potentials | ||||||||||
| logp = tt.sum([tt.sum(factor) for factor in factors]) | ||||||||||
|
|
||||||||||
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.