-
Notifications
You must be signed in to change notification settings - Fork 288
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
Add random state #204
Add random state #204
Conversation
2235d35
to
6a855bb
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.
Added a few comments. The ones added to sdv-dev/Copulas#313 should be considered as well.
Also, I think that integration tests should be added to ensure that the effect of setting the seed is the expected one.
ctgan/synthesizers/base.py
Outdated
import torch | ||
|
||
|
||
@contextlib.contextmanager | ||
def set_random_state(random_state, set_model_random_state): |
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.
Since this uses torch
, should we be setting the torch
seed too?
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.
Other than the torch
seed, which concerns me as well, I think this looks good. Here is a resource regarding randomness on pytorch
: https://pytorch.org/docs/stable/notes/randomness.html
110f3f6
to
10bbcd5
Compare
10bbcd5
to
8243fbf
Compare
Codecov Report
@@ Coverage Diff @@
## master #204 +/- ##
==========================================
+ Coverage 36.09% 38.73% +2.63%
==========================================
Files 10 10
Lines 676 710 +34
==========================================
+ Hits 244 275 +31
- Misses 432 435 +3
Continue to review full report at Codecov.
|
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 added a couple minor comments, but other than that this looks ready to go
3f2ded9
to
807593a
Compare
Add random state field to CTGAN and TVAE models.
random_state
on base classrandom_state
decorator to use around sampling methods