Comments (4)
Hi @arrayslayer ,
I'm going to give you a very general answer because I'm not as familiar as @csala . But it's my understanding that the initial seed state that the synthesiser starts from is random, which will cause the loss function to start from different places every time you initiate a new instance of the synthesizer. Furthermore, even if we used a consistent seed value the sampling results would still be different each time since we are randomly sampling from a distribution that is learned by the model.
You would need to fork and modify the code to set a consistent seed value for synthesizer and tell the sampling method to stop randomly sampling from a distribution, instead set it to sample from a consistent point along the distribution each time. However, if you do this, my guess is that it would only be capable of producing very limited numbers of unique rows before the generated rows keep repeating themselves over and over again...(?)
Perhaps there is enough of a use-case for your problem this that this could be implemented in the future. I'm guessing it wouldn't be too hard to allow users to select a pre-defined seed state prior to fitting.
from ctgan.
Hi @oregonpillow ,
Thanks a lot for the detailed response. I added numpy and torch seeds to the synthesizer and transformer and it did the trick. I also set a random state in the GMM model. I get reproducible results now !
However, I am not sure how it is going to impact the fact that I could be able to only sample limited number of unique rows. I'll test that out.
If you guys want that as a user feature, I can submit a PR.
Thanks again 👍
from ctgan.
Awesome @arrayslayer, I'm glad you figured it out.
Yes, a PR would be welcome, though I'd appreciate if you can share a few details here beforehand about how you implemented it, so we can briefly discuss if those are all the required changes or if something else should be added to it.
from ctgan.
@csala
Definitely.
So, I have set the seeds of numpy and torch in the synthesizer and transformer. I set it in the init.
Also, I have set the random state in GMM model in transformer. I am attaching the git diff screenshot for your reference.
We can probably pass seed as a parameter in the fit() function if we want user to change seeds.
from ctgan.
Related Issues (20)
- Transition from using setup.py to pyproject.toml to specify project metadata
- Remove bumpversion and use bump-my-version
- Switch to using ruff for Python linting and code formatting
- Add dependency checker
- Remove scikit-learn dependency
- CTGAN using deprecated 'sklearn' HOT 2
- Replace integration test that uses the iris demo data
- Add bandit workflow
- Feature Request: More verbose logging HOT 3
- Fix minimum version workflow when pointing to github branch
- Deployment requirements based on libtorch or ONNX HOT 4
- How to load this model directly to generate data after saving it HOT 4
- Cleanup automated PR workflows
- Remove FutureWarning: Setting an item of incompatible dtype is deprecated
- Only run unit and integration tests on oldest and latest python versions for macos
- [HELP] CTGAN has Reproducibility? HOT 8
- Add support for numpy 2.0.0
- Cap numpy to less than 2.0.0 until CTGan supports
- Lossvalues are good, but the quality of the synthetic data is bad... How?? HELP WANTED HOT 1
- There was a problem generating data when specifying column names and value HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ctgan.