Stop using learning_phase: it's a global variable, and currently broken anyway

main
Aurélien Geron 2019-05-09 16:26:38 +08:00
parent a758ea50b0
commit 7b1c890195
1 changed files with 0 additions and 4 deletions

View File

@ -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",