Git Product home page Git Product logo

Comments (7)

philipperemy avatar philipperemy commented on August 30, 2024

@sishue good point. In tensorflow, it's very difficult to have reproducible results (especially on a GPU).

from keras-tcn.

lingdoc avatar lingdoc commented on August 30, 2024

Just a heads-up that reproducible results are possible on (NVIDIA) GPUs using the tensorflow-determinism library. I've been getting reproducible results consistently for CNNs, and I also just tested with keras-tcn and got reproducible results, so it is possible.

from keras-tcn.

philipperemy avatar philipperemy commented on August 30, 2024

@lingdoc yeah you're right. Can you detail the steps to make it reproducible? That would be highly appreciated!

from keras-tcn.

philipperemy avatar philipperemy commented on August 30, 2024

Is it just adding those lines at the beginning of the script that you run?

import tensorflow as tf
from tfdeterminism import patch
patch()
os.environ['PYTHONHASHSEED']=str(SEED)
random.seed(SEED)
np.random.seed(SEED)
tf.set_random_seed(SEED)
# use tf as normal

from keras-tcn.

lingdoc avatar lingdoc commented on August 30, 2024

yes, after installing the library and setting SEED to some value, i.e. SEED = 54. I'm running on TF 1.15, btw - haven't tried it on TF 2.0

This should ensure that any sources of randomization, like shuffle=True in the Keras model.fit() call or the various split functions in sklearn will be deterministic, provided they are using one of these random seeds. One caveat is that if you change your hardware or model architecture it seems the results will be different, but as long as all the hardware is the same I get the same outcome from running the same model.

from keras-tcn.

philipperemy avatar philipperemy commented on August 30, 2024

That sounds already very promising! Thank you very much for the feedback. I'm going to add it to the README

from keras-tcn.

philipperemy avatar philipperemy commented on August 30, 2024

Done! @sishue try the tensorflow-determinism library. It should work!

from keras-tcn.

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.