Skip to content

Commit

Permalink
Do not use learning_phase anymore, just set training=True/False
Browse files Browse the repository at this point in the history
  • Loading branch information
ageron committed May 9, 2019
1 parent 617ee5f commit 2bd7ca1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions 11_training_deep_neural_networks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3107,8 +3107,7 @@
"metadata": {},
"outputs": [],
"source": [
"#with keras.backend.learning_phase_scope(1): # TODO: check https://github.com/tensorflow/tensorflow/issues/25754\n",
"# history = model.fit(X_train_scaled, y_train)"
"history = model.fit(X_train_scaled, y_train)"
]
},
{
Expand All @@ -3134,8 +3133,8 @@
"metadata": {},
"outputs": [],
"source": [
"with keras.backend.learning_phase_scope(1): # TODO: check https://github.com/tensorflow/tensorflow/issues/25754\n",
" y_probas = np.stack([model.predict(X_test_scaled) for sample in range(100)])\n",
"y_probas = np.stack([model(X_test_scaled, training=True)\n",
" for sample in range(100)])\n",
"y_proba = y_probas.mean(axis=0)\n",
"y_std = y_probas.std(axis=0)"
]
Expand Down

0 comments on commit 2bd7ca1

Please sign in to comment.