-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
seeding fix for xvalmmd #4784
base: develop
Are you sure you want to change the base?
seeding fix for xvalmmd #4784
Conversation
@lambday this change currently breaks some mmd unit tests :( |
@vigsterkr for CrossValidationMMD unit-tests, the checks are more fundamental it seems, cannot just update to the new values. Is the internal SGObject also using |
yep it's the same prng all over |
@lambday note that if i would just add there 2 dummy calls for the prng, before creating the folds objects, things would pass... |
@@ -195,16 +195,11 @@ struct CrossValidationMMD : PermutationMMD | |||
SGVector<int64_t> dummy_labels_x(m_n_x); | |||
SGVector<int64_t> dummy_labels_y(m_n_y); | |||
|
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.
@lambday i'm pretty sure that if i would do prng(); prng();
this patch would pass
@lambday in fact i've just tested it locally and the hack i've written actually makes all the unit tests pass that are currently failing... so this is just the problem of having the right expected value/seed |
@vigsterkr adding dummy calls to the main codebase might not be the ideal way to go here I think. Would it be possible to create two different prng instances in the unit-test rather? e.g. one instance to pass to the |
For the other failing unit-test, we can just update to the new value that it gets. |
Not so sure I understand the rational for this separate prng...?
And why not just to update the seed or expected value? I mean it does not use one global prng, but objects that are nested and have prngs there the prng is shared... but eg the data generators in the unit test and xvalmmd doesn’t share one prng...
… On 24 Oct 2019, at 05:31, Soumyajit De ***@***.***> wrote:
@vigsterkr adding dummy calls to the main codebase might not be the ideal way to go here I think. Would it be possible to create two different prng instances in the unit-test rather? e.g. one instance to pass to the CrossValidationMMD guy here and another one to pass to the explicit testing logic here. Both should have the same seed. I think that might solve the problem as well?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@vigsterkr for But it's a bit tricky for the Now, these two independent computations would yield the same result, if we feed each of them the same class of prng with the same state. But as per the present logic, we are using the same prng instance to compute one after another - these two computations are not independent anymore. This is why the these are not giving the same result I am afraid. I think if we can just create two instances of the prng with the same seed in these unit-tests, pass one to the shogun |
@lambday this is now how it works that we just pass on things with prngs :) these guys dont share a prng.... just saying... so then jsut updating the results should be fine right? |
@lambday i guess this is what u had in mind 7022a56 note that every test in CrossValidationMMD unit tests fails atm with this change, but since the only check is
i'm not so sure what is update-able here...? the other test that fails is
|
note that if i revert the change in CrossValidationMMD but keep the prng changes you've requested, there's still one test that fails: CrossValidationMMD.unbiased_incomplete |
@lambday any ideas? since now we have 2 same type but separate prng seeded with the same seed... but the unit test still fails :( |
@vigsterkr let me check this out.. worst case scenario, we're gonna remove the explicit computation logic and put an array of constant expected values... but I want to understand why these are still not giving the same result.. |
@lambday any updates on this by any chance? |
@vigsterkr hi! I tried to reproduce the issue in my local and it seems like the issue is solved? |
@vigsterkr is this still an issue? |
yep |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
fix #4783