Skip to content

Commit

Permalink
Merge pull request #153 from IamShubhamGupto/fix/gp-lorenz
Browse files Browse the repository at this point in the history
fix GP deprecation with tf-keras
  • Loading branch information
dhruvbalwada authored Jun 6, 2024
2 parents da2f5de + 1425631 commit 1980cfd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
14 changes: 5 additions & 9 deletions notebooks/GP_lorenz96.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
"import gpflow\n",
"from L96_model import L96, L96_eq1_xdot, integrate_L96_2t\n",
"from L96_model import EulerFwd, RK2, RK4\n",
"import os\n",
"\n",
"os.environ[\"TF_USE_LEGACY_KERAS\"] = \"True\"\n",
"\n",
"time_method = RK4"
]
Expand Down Expand Up @@ -335,7 +338,7 @@
" train_iter = iter(train_dataset.batch(batch_size))\n",
" training_loss = model.training_loss_closure(train_iter, compile=True)\n",
"\n",
" optimizer = tf.optimizers.Adam()\n",
" optimizer = tf.keras.optimizers.legacy.Adam()\n",
"\n",
" @tf.function\n",
" def optimization_step(trainable_variables):\n",
Expand Down Expand Up @@ -893,13 +896,6 @@
"plt.legend(frameon=False, fontsize=7)\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -918,7 +914,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
"version": "3.9.19"
}
},
"nbformat": 4,
Expand Down
Binary file modified notebooks/figs/Burgers_simulation.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified notebooks/figs/L96_one_variable.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ pysindy
torch-lr-finder
gplearn
gpflow
tf-keras

0 comments on commit 1980cfd

Please sign in to comment.