Updates to the codelab.

PiperOrigin-RevId: 318054616
This commit is contained in:
A. Unique TensorFlower 2020-06-24 06:40:27 -07:00
parent 74bd89d754
commit 18fe9eb3aa

View file

@ -135,6 +135,16 @@
"from tensorflow_privacy.privacy.membership_inference_attack import membership_inference_attack as mia"
]
},
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
"id": "pBbcG86th_sW"
},
"source": [
"## Train a simple model on CIFAR10 with Keras."
]
},
{
"cell_type": "code",
"execution_count": null,
@ -145,8 +155,6 @@
},
"outputs": [],
"source": [
"#@title Train a simple model on CIFAR10 with Keras.\n",
"\n",
"dataset = 'cifar10'\n",
"num_classes = 10\n",
"num_conv = 3\n",
@ -254,6 +262,16 @@
"loss_test = cce(constant(y_test), constant(prob_test), from_logits=False).numpy()"
]
},
{
"cell_type": "markdown",
"metadata": {
"colab_type": "text",
"id": "QETxVOHLiHP4"
},
"source": [
"## Run membership inference attacks."
]
},
{
"cell_type": "code",
"execution_count": null,
@ -264,7 +282,6 @@
},
"outputs": [],
"source": [
"#@title Run membership inference attacks.\n",
"#@markdown We will now execute membership inference attack against the\n",
"#@markdown previously trained CIFAR10 model. This will generate a number of\n",
"#@markdown scores (most notably, attacker advantage and AUC for the membership\n",