Thursday, November 29, 2018

Fixed randomness for tensorflow.keras for reproducible runs

Just follow the FAQ here
One of the steps is to set environment variable PYTHONHASHSEED=0 before starting python. For Visual Studio Code, you need to add the environment setting like the following in the configuration (can be opened through Menu->Debug->Open Configurations)

"configurations": [
{
    "name": "Python: Current File (Integrated Terminal)",
    "type": "python",
    "request": "launch",
    "program": "${file}",
    "console": "integratedTerminal",
    "debugStdLib": true,
    "env": {"PYTHONHASHSEED": 0}
},

No comments: