Skip to content

Commit

Permalink
fixup! Add support for TensorFlow 2.16
Browse files Browse the repository at this point in the history
  • Loading branch information
drasmuss committed Apr 5, 2024
1 parent d2ac24f commit abf92c4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
Binary file modified docs/examples/psMNIST-training.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/examples/psMNIST-weights.hdf5
Binary file not shown.
9 changes: 6 additions & 3 deletions docs/examples/psMNIST.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,13 @@
"batch_size = 100\n",
"epochs = 10\n",
"\n",
"saved_weights_fname = \"./psMNIST-weights.hdf5\"\n",
"saved_model_fname = \"./psMNIST.keras\"\n",
"callbacks = [\n",
" keras.callbacks.ModelCheckpoint(\n",
" filepath=saved_weights_fname, monitor=\"val_loss\", verbose=1, save_best_only=True\n",
" filepath=saved_model_fname,\n",
" monitor=\"val_accuracy\",\n",
" verbose=1,\n",
" save_best_only=True,\n",
" ),\n",
"]\n",
"\n",
Expand Down Expand Up @@ -394,7 +397,7 @@
"metadata": {},
"outputs": [],
"source": [
"model.load_weights(saved_weights_fname)\n",
"model.load_weights(saved_model_fname)\n",
"accuracy = model.evaluate(X_test, Y_test)[1] * 100\n",
"print(f\"Test accuracy: {round(accuracy, 2):0.2f}%\")"
]
Expand Down
Binary file added docs/examples/psMNIST.keras
Binary file not shown.

0 comments on commit abf92c4

Please sign in to comment.