Skip to content

Commit

Permalink
added code for saving the state of runtime monitor during training an…
Browse files Browse the repository at this point in the history
…d a sample code for loading the state of the monitor during deployment
  • Loading branch information
Amit Sahu committed Sep 2, 2020
1 parent 16b5021 commit 7b77766
Showing 1 changed file with 42 additions and 1 deletion.
43 changes: 42 additions & 1 deletion MNIST_RuntimeMonitoring.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,47 @@
" print('Accuracy of the network on the all train images: {} %'.format(100 * correct / total))\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Save the state of run-time monitoring \n",
"\n",
"Following code saves the napmonitor for using it as runtime monitor in the deployment code."
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
"import pickle\n",
"\n",
"with open('napmonitor.pkl', 'wb') as output:\n",
" pickle.dump(monitor, output, pickle.HIGHEST_PROTOCOL)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### Load the state of run-time monitoring \n",
"Following code is a sample of how to load the monitor during deployment."
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [],
"source": [
"# import pickle\n",
"\n",
"# with open('napmonitor.pkl', 'rb') as input:\n",
"# monitor = pickle.load(input)"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -1193,7 +1234,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.6"
"version": "3.7.3"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 7b77766

Please sign in to comment.