Git Product home page Git Product logo

Comments (4)

oregonpillow avatar oregonpillow commented on September 16, 2024

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.

adityalahiri avatar adityalahiri commented on September 16, 2024

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.

csala avatar csala commented on September 16, 2024

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.

adityalahiri avatar adityalahiri commented on September 16, 2024

@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.

image

from ctgan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.