Skip to content

Commit

Permalink
try more reproducibility
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunsavel committed Feb 29, 2024
1 parent 20ee63f commit 1ccb826
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion docs/pages/fitting_nn.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@
"np.random.seed(seed)\n",
"tf.random.set_seed(seed)\n",
"os.environ[\"PYTHONHASHSEED\"] = str(seed)\n",
"random.seed(seed)"
"random.seed(seed)\n",
"\n",
"keras.utils.set_random_seed(seed)\n",
"\n",
"# note that setting this flag helps with reproducibility, but it may result in a performance hit.\n",
"tf.config.experimental.enable_op_determinism()"
]
},
{
Expand Down Expand Up @@ -431,6 +436,14 @@
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "4e8f6df0-a216-45a1-ba14-1cdc4755b724",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down

0 comments on commit 1ccb826

Please sign in to comment.