-
-
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
Use an incrementally updated RNG state in Model
#4729
Conversation
I guess this also affects variables created via |
Are successive |
Howso? |
NVM, I thought they were also given the model rng |
If we keep the uncoordinated merge of #4718 it forces me to rebase the #4696 branch--unless someone else steps in to help out. Call me overreacting, but out of respect for a fellow core contributor please don't merge anything into |
Out of respect for the core developers and anyone who might be interested in using Regardless, I won't merge this until others weigh in. |
I don't remember that we've locked branches (including We do have tools to resolve this, namely a rebase, and I don't see how it would be a particularly difficult one in this case. Plus, we will have to rebase #4696 anyway. I'm not at all saying that's on you @michaelosthege as you said before that the PR is done from your side, and that's totally fine. |
@brandonwillard So changing the |
No, not exclusively; changing the Otherwise, the uniqueness in question is consistent and fundamental to general graph representations, and also how Aesara is designed: if the same We could make Aside from all that, this lack of uniqueness can result in real bugs, because a compiled function that conflates equivalent |
If we changed this so that it worked more like Update: it's definitely the better approach; I'll rebase this with the changes soon. |
c6e31b5
to
53f6f43
Compare
The changes I just pushed allow The Also, the forced in-place The standard |
The current failure is pretty straightforward: It's a pretty straightforward fix (i.e. don't use |
3fedaa2
to
d279e89
Compare
5a63903
to
a48db14
Compare
bb3c3c4
to
186b4f5
Compare
186b4f5
to
8dd92e5
Compare
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.
Should we test that rvs can still be merged when they are in fact repeated in the graph expression?
No, that's very much Aesara's responsibility. |
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.
LGTM
|
I agree that we should reconsider this breaking change. The value is still assigned to |
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.
(see comment about breaking change above)
What's a breaking change? A deprecation warning was added, but Regardless, folks, don't forget that this is a new version, and that there's no practical benefit to preserving a misnomer like |
I think the deprecation warning we have here is fine, but should definitely add a note in the release-notes on this change. |
8dd92e5
to
62530f5
Compare
62530f5
to
dd0c577
Compare
dd0c577
to
b1f95e5
Compare
The former confirms that this is not a breaking change, and the latter wouldn't be a confusion, because |
Yet another warning has been added
This PR updates the role of
Model.default_rng
by adding aModel.next_rng
that is incrementally updated when variables are registered.Under this change,
Model.default_rng
still serves as a mutable starting point for RNG seeding, while also (softly) guaranteeing that newly added/registered random variables—that don't specify their ownrng
parameters—will be unique.This PR also updates how initial values are specified, stored, and generated. Since computing initial values may require sampling, these updates were needed in order to prevent initial values from unnecessarily affecting the RNG states in confusing ways.
Closes #4728