Skip to content

Commit

Permalink
Fix classification_privacy.ipynb
Browse files Browse the repository at this point in the history
Fixed by calling `compute_dp_sgd_privacy_statement`.
  • Loading branch information
vertexcite committed Nov 2, 2023
1 parent 39c8a8c commit e07bcfb
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions g3doc/tutorials/classification_privacy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,20 @@
"id": "MfBg1C5NB3X0"
},
"source": [
"\u003ctable class=\"tfo-notebook-buttons\" align=\"left\"\u003e\n",
" \u003ctd\u003e\n",
" \u003ca target=\"_blank\" href=\"https://www.tensorflow.org/responsible_ai/privacy/tutorials/classification_privacy\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/tf_logo_32px.png\" /\u003eView on TensorFlow.org\u003c/a\u003e\n",
" \u003c/td\u003e\n",
" \u003ctd\u003e\n",
" \u003ca target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/privacy/blob/master/g3doc/tutorials/classification_privacy.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" /\u003eRun in Google Colab\u003c/a\u003e\n",
" \u003c/td\u003e\n",
" \u003ctd\u003e\n",
" \u003ca target=\"_blank\" href=\"https://github.com/tensorflow/privacy/blob/master/g3doc/tutorials/classification_privacy.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" /\u003eView source on GitHub\u003c/a\u003e\n",
" \u003c/td\u003e\n",
" \u003ctd\u003e\n",
" \u003ca href=\"https://storage.googleapis.com/tensorflow_docs/privacy/g3doc/tutorials/classification_privacy.ipynb\"\u003e\u003cimg src=\"https://www.tensorflow.org/images/download_logo_32px.png\" /\u003eDownload notebook\u003c/a\u003e\n",
" \u003c/td\u003e\n",
"\u003c/table\u003e"
"<table class=\"tfo-notebook-buttons\" align=\"left\">\n",
" <td>\n",
" <a target=\"_blank\" href=\"https://www.tensorflow.org/responsible_ai/privacy/tutorials/classification_privacy\"><img src=\"https://www.tensorflow.org/images/tf_logo_32px.png\" />View on TensorFlow.org</a>\n",
" </td>\n",
" <td>\n",
" <a target=\"_blank\" href=\"https://colab.research.google.com/github/tensorflow/privacy/blob/master/g3doc/tutorials/classification_privacy.ipynb\"><img src=\"https://www.tensorflow.org/images/colab_logo_32px.png\" />Run in Google Colab</a>\n",
" </td>\n",
" <td>\n",
" <a target=\"_blank\" href=\"https://github.com/tensorflow/privacy/blob/master/g3doc/tutorials/classification_privacy.ipynb\"><img src=\"https://www.tensorflow.org/images/GitHub-Mark-32px.png\" />View source on GitHub</a>\n",
" </td>\n",
" <td>\n",
" <a href=\"https://storage.googleapis.com/tensorflow_docs/privacy/g3doc/tutorials/classification_privacy.ipynb\"><img src=\"https://www.tensorflow.org/images/download_logo_32px.png\" />Download notebook</a>\n",
" </td>\n",
"</table>"
]
},
{
Expand Down Expand Up @@ -417,11 +417,12 @@
},
"outputs": [],
"source": [
"compute_dp_sgd_privacy.compute_dp_sgd_privacy(n=train_data.shape[0],\n",
"print(compute_dp_sgd_privacy.compute_dp_sgd_privacy_statement(\n",
" number_of_examples=train_data.shape[0],\n",
" batch_size=batch_size,\n",
" noise_multiplier=noise_multiplier,\n",
" epochs=epochs,\n",
" delta=1e-5)"
" num_epochs=epochs,\n",
" delta=1e-5))"
]
},
{
Expand All @@ -430,7 +431,7 @@
"id": "c-KyttEWFRDc"
},
"source": [
"The tool reports that for the hyperparameters chosen above, the trained model has an $\\epsilon$ value of 1.18."
"The tool reports that for the hyperparameters chosen above, the trained model has an $\\epsilon$ value of 3.426."
]
},
{
Expand Down

0 comments on commit e07bcfb

Please sign in to comment.