Skip to content

Commit 9a1b79c

Browse files
Update DQN Atari Space Invaders.ipynb
1 parent cb001ae commit 9a1b79c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

DQN/Space Invaders/DQN Atari Space Invaders.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -767,9 +767,9 @@
767767
" target_Qs_batch = []\n",
768768
"\n",
769769
" # Get Q values for next_state \n",
770-
" target_Qs = sess.run(DQNetwork.output, feed_dict = {DQNetwork.inputs_: next_states_mb})\n",
770+
" Qs_next_state = sess.run(DQNetwork.output, feed_dict = {DQNetwork.inputs_: next_states_mb})\n",
771771
" \n",
772-
" # Set Qhat = r if the episode ends at s+1, otherwise set Qhat = r + gamma*maxQ(s', a')\n",
772+
" # Set Q_target = r if the episode ends at s+1, otherwise set Qhat = r + gamma*maxQ(s', a')\n",
773773
" for i in range(0, len(batch)):\n",
774774
" terminal = dones_mb[i]\n",
775775
"\n",
@@ -778,7 +778,7 @@
778778
" target_Qs_batch.append(rewards_mb[i])\n",
779779
" \n",
780780
" else:\n",
781-
" target = rewards_mb[i] + gamma * np.max(target_Qs[i])\n",
781+
" target = rewards_mb[i] + gamma * np.max(Qs_next_state[i])\n",
782782
" target_Qs_batch.append(target)\n",
783783
" \n",
784784
"\n",

0 commit comments

Comments
 (0)