From 7b1c8901950801797d11f887fc93ba368e15b861 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Geron?= Date: Thu, 9 May 2019 16:26:38 +0800 Subject: [PATCH] Stop using learning_phase: it's a global variable, and currently broken anyway --- 12_custom_models_and_training_with_tensorflow.ipynb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/12_custom_models_and_training_with_tensorflow.ipynb b/12_custom_models_and_training_with_tensorflow.ipynb index 887c5c7..3dec28f 100644 --- a/12_custom_models_and_training_with_tensorflow.ipynb +++ b/12_custom_models_and_training_with_tensorflow.ipynb @@ -1803,8 +1803,6 @@ " self.stddev = stddev\n", "\n", " def call(self, X, training=None):\n", - " if training is None:\n", - " training = keras.backend.learning_phase()\n", " if training:\n", " noise = tf.random.normal(tf.shape(X), stddev=self.stddev)\n", " return X + noise\n", @@ -1990,8 +1988,6 @@ "\n", " @tf.function\n", " def call(self, inputs, training=None):\n", - " if training is None:\n", - " training = keras.backend.learning_phase()\n", " Z = inputs\n", " for layer in self.hidden:\n", " Z = layer(Z)\n",