-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Refactor pm.Simulator (WIP) #4802
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2865440
Start refactoring Simulator
ricardoV94 0e5d6f7
Add example test with more than 1 Simulator
ricardoV94 58e2972
Deprecate ABC-specific code and arguments and compile rv_inplace
ricardoV94 a8c041f
Automatically wrap Simulator non-symbolic functions in Aesara Ops
ricardoV94 7e01fd2
Run all ABC tests in single process
ricardoV94 729daea
Standardize Simulator logp
ricardoV94 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
********** | ||
Simulator | ||
********** | ||
|
||
.. currentmodule:: pymc3.distributions.simulator | ||
.. autosummary:: | ||
|
||
Simulator | ||
|
||
.. automodule:: pymc3.distributions.simulator | ||
:members: |
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
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.
locally defined functions often cause problems with pickling.
Also it looks like this
logp
uses variables from the__new__
scope. Doesn't this, in combination with the register lead to problems when having more than oneSimulator
?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.
I am not sure about pickling. Depends on the point at which the function is used (after obtaining the logp graph, the function is not needed anymore).
The registration part should be fine because I am creating a new
type
which has a unique name. I also have a test for multiple Simulators with different methods and it seems to be fine.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.
I can also try to add a layer of indirection when creating the simulator so that I can attach what are now the local variables to the
tag
, in which case a single logp function / dispatcher would be enough.