Skip to content

Commit

Permalink
chore: clear extra content from tensorflow-mnist-classifier notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
jkglasbrenner authored Dec 19, 2023
1 parent 75c449a commit 299b962
Showing 1 changed file with 12 additions and 204 deletions.
216 changes: 12 additions & 204 deletions examples/tensorflow-mnist-classifier/demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {
"tags": []
},
Expand Down Expand Up @@ -171,22 +171,11 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": null,
"metadata": {
"tags": []
},
"outputs": [
{
"data": {
"text/plain": [
"PosixPath('/Users/jglasbrenner/Code/NIST - Direct Work/dioptra/examples/tensorflow-mnist-classifier/workflows.tar.gz')"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"make_tar([\"src\"], WORKFLOWS_TAR_GZ)"
]
Expand All @@ -202,7 +191,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {
"tags": []
},
Expand All @@ -211,26 +200,6 @@
"restapi_client = DioptraClient()"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'http://localhost:80/api/taskPlugin/'"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"restapi_client.task_plugin_endpoint"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -242,25 +211,11 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {
"tags": []
},
"outputs": [
{
"data": {
"text/plain": [
"{'experimentId': 1,\n",
" 'createdOn': '2023-09-08T20:10:44.625973',\n",
" 'lastModified': '2023-09-08T20:10:44.625973',\n",
" 'name': 'mnist'}"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"response_experiment = restapi_client.get_experiment_by_name(name=EXPERIMENT_NAME)\n",
"\n",
Expand Down Expand Up @@ -305,51 +260,6 @@
"```"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Training job for shallow neural network submitted\n",
"\n",
"{'createdOn': '2023-09-08T20:16:01.141053',\n",
" 'dependsOn': None,\n",
" 'entryPoint': 'train',\n",
" 'entryPointKwargs': '-P model_architecture=shallow_net -P epochs=3 -P '\n",
" 'register_model_name=mnist_shallow_net',\n",
" 'experimentId': 1,\n",
" 'jobId': '4ac4c474-6752-426f-b304-1b280d26dd23',\n",
" 'lastModified': '2023-09-08T20:16:01.141053',\n",
" 'mlflowRunId': None,\n",
" 'queueId': 1,\n",
" 'status': 'queued',\n",
" 'timeout': '24h',\n",
" 'workflowUri': 's3://workflow/851b056a75214e6eacfc80fae789e234/workflows.tar.gz'}\n"
]
}
],
"source": [
"# Submit training job for the shallow network architecture\n",
"response_shallow_train = restapi_client.submit_job(\n",
" workflows_file=WORKFLOWS_TAR_GZ,\n",
" experiment_name=EXPERIMENT_NAME,\n",
" entry_point=\"train\",\n",
" entry_point_kwargs=\" \".join([\n",
" \"-P model_architecture=shallow_net\",\n",
" \"-P epochs=3\",\n",
" \"-P register_model_name=mnist_shallow_net\",\n",
" ]),\n",
")\n",
"\n",
"print(\"Training job for shallow neural network submitted\")\n",
"print(\"\")\n",
"pprint.pprint(response_shallow_train)"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -373,51 +283,6 @@
"```"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Training job for LeNet-5 neural network submitted\n",
"\n",
"{'createdOn': '2023-09-08T20:30:26.581489',\n",
" 'dependsOn': None,\n",
" 'entryPoint': 'train',\n",
" 'entryPointKwargs': '-P model_architecture=le_net -P epochs=2 -P '\n",
" 'register_model_name=mnist_le_net',\n",
" 'experimentId': 1,\n",
" 'jobId': 'e760b65d-8711-4653-9e30-e49bfce752d2',\n",
" 'lastModified': '2023-09-08T20:30:26.581489',\n",
" 'mlflowRunId': None,\n",
" 'queueId': 1,\n",
" 'status': 'queued',\n",
" 'timeout': '24h',\n",
" 'workflowUri': 's3://workflow/e83c9d57f69a4740955d0a8e193863e3/workflows.tar.gz'}\n"
]
}
],
"source": [
"# Submit training job for the LeNet-5 network architecture\n",
"response_le_net_train = restapi_client.submit_job(\n",
" workflows_file=WORKFLOWS_TAR_GZ,\n",
" experiment_name=EXPERIMENT_NAME,\n",
" entry_point=\"train\",\n",
" entry_point_kwargs=\" \".join([\n",
" \"-P model_architecture=le_net\",\n",
" \"-P epochs=2\",\n",
" \"-P register_model_name=mnist_le_net\",\n",
" ]),\n",
")\n",
"\n",
"print(\"Training job for LeNet-5 neural network submitted\")\n",
"print(\"\")\n",
"pprint.pprint(response_le_net_train)"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -438,32 +303,9 @@
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"FGM attack (shallow net architecture) job submitted\n",
"\n",
"{'createdOn': '2023-09-08T20:33:00.250653',\n",
" 'dependsOn': None,\n",
" 'entryPoint': 'fgm',\n",
" 'entryPointKwargs': '-P model_name=mnist_shallow_net -P model_version=1',\n",
" 'experimentId': 1,\n",
" 'jobId': 'fb4ff178-513d-4bf0-8ae5-a38a6d05ee22',\n",
" 'lastModified': '2023-09-08T20:33:00.250653',\n",
" 'mlflowRunId': None,\n",
" 'queueId': 1,\n",
" 'status': 'queued',\n",
" 'timeout': '24h',\n",
" 'workflowUri': 's3://workflow/a752e16b67a844738fb14c08fe1ab0cf/workflows.tar.gz'}\n",
"\n",
"Dependent jobs submitted\n"
]
}
],
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"def mlflow_run_id_is_not_known(response_fgm):\n",
" return response_fgm[\"mlflowRunId\"] is None and response_fgm[\"status\"] not in [\n",
Expand Down Expand Up @@ -532,43 +374,9 @@
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'createdOn': '2023-09-08T20:33:08.492395',\n",
" 'dependsOn': 'fb4ff178-513d-4bf0-8ae5-a38a6d05ee22',\n",
" 'entryPoint': 'infer',\n",
" 'entryPointKwargs': '-P run_id=b428e6d756f24a1d870a4f1e41f9232c -P '\n",
" 'model_name=mnist_shallow_net -P model_version=1',\n",
" 'experimentId': 1,\n",
" 'jobId': '41918462-f0d1-4843-8bc5-10a957712a48',\n",
" 'lastModified': '2023-09-08T20:33:29.866172',\n",
" 'mlflowRunId': '9c969ceab8ba4e97928a27d53fc6f31f',\n",
" 'queueId': 1,\n",
" 'status': 'finished',\n",
" 'timeout': '24h',\n",
" 'workflowUri': 's3://workflow/5ef86348918a418a8f34e40db9d13aea/workflows.tar.gz'}\n",
"\n",
"{'createdOn': '2023-09-08T20:33:08.513217',\n",
" 'dependsOn': 'fb4ff178-513d-4bf0-8ae5-a38a6d05ee22',\n",
" 'entryPoint': 'infer',\n",
" 'entryPointKwargs': '-P run_id=b428e6d756f24a1d870a4f1e41f9232c -P '\n",
" 'model_name=mnist_le_net -P model_version=1',\n",
" 'experimentId': 1,\n",
" 'jobId': 'a5a23840-07ff-47d2-9465-c07c93c5e017',\n",
" 'lastModified': '2023-09-08T20:33:43.959382',\n",
" 'mlflowRunId': 'cce30073c5a74066b0c9d741e392df9b',\n",
" 'queueId': 1,\n",
" 'status': 'finished',\n",
" 'timeout': '24h',\n",
" 'workflowUri': 's3://workflow/fbdf24d0640c4fcc886b0f7ae39fb8b5/workflows.tar.gz'}\n"
]
}
],
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"response_shallow_net_infer_shallow_net = restapi_client.get_job_by_id(\n",
" response_shallow_net_infer_shallow_net[\"jobId\"]\n",
Expand Down

0 comments on commit 299b962

Please sign in to comment.