File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ def __init__(
160
160
# YOUR CODE HERE
161
161
162
162
# Formula from "classic deep learning" in http://rail.eecs.berkeley.edu/deeprlcourse/static/slides/lec-8.pdf slide
163
- self .q_t = q_func (self . obs_t_ph , self .num_actions , scope = "q" )
163
+ self .q_t = q_func (obs_t_float , self .num_actions , scope = "q" )
164
164
165
165
# select the corresponding action from q_t for yhat
166
166
row_indices = tf .range (tf .shape (self .act_t_ph )[0 ])
@@ -170,11 +170,11 @@ def __init__(
170
170
qtarget_tp1 = q_func (self .obs_tp1_ph , self .num_actions , scope = "q_target" )
171
171
y = self .rew_t_ph + gamma * tf .reduce_max (qtarget_tp1 , axis = - 1 ) * (1. - self .done_mask_ph )
172
172
173
+ self .total_error = tf .reduce_mean (huber_loss (yhat - y ))
174
+
173
175
q_func_vars = tf .get_collection (tf .GraphKeys .GLOBAL_VARIABLES , "q" )
174
176
target_q_func_vars = tf .get_collection (tf .GraphKeys .GLOBAL_VARIABLES , "q_target" )
175
177
176
- self .total_error = huber_loss (yhat - y )
177
-
178
178
######
179
179
180
180
# construct optimization op (with gradient clipping)
You can’t perform that action at this time.
0 commit comments