tf.contrib.layers.variance_scaling_initializer moved to tf.variance_scaling_initializer

main
Aurélien Geron 2018-05-08 19:40:05 +02:00
parent 38c2ea79e4
commit e05d4b36ac
1 changed files with 5 additions and 14 deletions

View File

@ -574,15 +574,6 @@
" plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"openai_cart_pole_rendering = False # don't try, just use the safe way?"
]
},
{
"cell_type": "code",
"execution_count": 26,
@ -783,7 +774,7 @@
"n_inputs = 4 # == env.observation_space.shape[0]\n",
"n_hidden = 4 # it's a simple task, we don't need more than this\n",
"n_outputs = 1 # only outputs the probability of accelerating left\n",
"initializer = tf.contrib.layers.variance_scaling_initializer()\n",
"initializer = tf.variance_scaling_initializer()\n",
"\n",
"# 2. Build the neural network\n",
"X = tf.placeholder(tf.float32, shape=[None, n_inputs])\n",
@ -883,7 +874,7 @@
"\n",
"learning_rate = 0.01\n",
"\n",
"initializer = tf.contrib.layers.variance_scaling_initializer()\n",
"initializer = tf.variance_scaling_initializer()\n",
"\n",
"X = tf.placeholder(tf.float32, shape=[None, n_inputs])\n",
"y = tf.placeholder(tf.float32, shape=[None, n_outputs])\n",
@ -1008,7 +999,7 @@
"\n",
"learning_rate = 0.01\n",
"\n",
"initializer = tf.contrib.layers.variance_scaling_initializer()\n",
"initializer = tf.variance_scaling_initializer()\n",
"\n",
"X = tf.placeholder(tf.float32, shape=[None, n_inputs])\n",
"\n",
@ -1481,7 +1472,7 @@
"n_hidden = 512\n",
"hidden_activation = tf.nn.relu\n",
"n_outputs = env.action_space.n # 9 discrete actions are available\n",
"initializer = tf.contrib.layers.variance_scaling_initializer()\n",
"initializer = tf.variance_scaling_initializer()\n",
"\n",
"def q_network(X_state, name):\n",
" prev_layer = X_state / 128.0 # scale pixel intensities to the [-1.0, 1.0] range.\n",
@ -1924,7 +1915,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.3"
"version": "3.5.2"
},
"nav_menu": {},
"toc": {