mirror of
https://github.com/ArthurDanjou/handson-ml3.git
synced 2026-01-14 12:14:36 +01:00
Do not use learning_phase anymore, just set training=True/False
This commit is contained in:
@@ -1828,8 +1828,7 @@
|
|||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"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)"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -1855,8 +1854,8 @@
|
|||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"with keras.backend.learning_phase_scope(1): # TODO: check https://github.com/tensorflow/tensorflow/issues/25754\n",
|
"y_probas = np.stack([model(X_test_scaled, training=True)\n",
|
||||||
" y_probas = np.stack([model.predict(X_test_scaled) for sample in range(100)])\n",
|
" for sample in range(100)])\n",
|
||||||
"y_proba = y_probas.mean(axis=0)\n",
|
"y_proba = y_probas.mean(axis=0)\n",
|
||||||
"y_std = y_probas.std(axis=0)"
|
"y_std = y_probas.std(axis=0)"
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user