From e05d4b36acb1f3e7f45991d507c5c94d20b5b30a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Geron?= Date: Tue, 8 May 2018 19:40:05 +0200 Subject: [PATCH] tf.contrib.layers.variance_scaling_initializer moved to tf.variance_scaling_initializer --- 16_reinforcement_learning.ipynb | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/16_reinforcement_learning.ipynb b/16_reinforcement_learning.ipynb index 30f2ab2..67ce80d 100644 --- a/16_reinforcement_learning.ipynb +++ b/16_reinforcement_learning.ipynb @@ -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": {