Stop using learning_phase: it's a global variable, and currently broken anyway
parent
a758ea50b0
commit
7b1c890195
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue