From e40a35f9c0f340bb850725f74ae55c98712a99b7 Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Wed, 24 Jun 2020 05:56:02 -0700 Subject: [PATCH] Updates to the membership inference codelab. PiperOrigin-RevId: 318049409 --- .../privacy/membership_inference_attack/codelab.ipynb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tensorflow_privacy/privacy/membership_inference_attack/codelab.ipynb b/tensorflow_privacy/privacy/membership_inference_attack/codelab.ipynb index b809e69..e717432 100644 --- a/tensorflow_privacy/privacy/membership_inference_attack/codelab.ipynb +++ b/tensorflow_privacy/privacy/membership_inference_attack/codelab.ipynb @@ -101,7 +101,6 @@ " pass\n", "\n", "import numpy as np\n", - "from colabtools import adhoc_import\n", "from typing import Tuple, Text\n", "from scipy import special\n", "\n", @@ -132,7 +131,7 @@ }, "outputs": [], "source": [ - "!pip install tensorflow_privacy\n", + "!pip3 install git+https://github.com/tensorflow/privacy\n", "\n", "from tensorflow_privacy.privacy.membership_inference_attack import membership_inference_attack as mia" ] @@ -252,8 +251,8 @@ "cce = tf.keras.backend.categorical_crossentropy\n", "constant = tf.keras.backend.constant\n", "\n", - "loss_train = cce(constant(y_train), prob_train, from_logits=False).numpy()\n", - "loss_test = cce(constant(y_test), prob_test, from_logits=False).numpy()" + "loss_train = cce(constant(y_train), constant(prob_train), from_logits=False).numpy()\n", + "loss_test = cce(constant(y_test), constant(prob_test), from_logits=False).numpy()" ] }, {