devsisters / DQN-tensorflow

Tensorflow implementation of Human-Level Control through Deep Reinforcement Learning
MIT License
2.46k stars 765 forks source link

clipped error function is not correct #55

Closed benjamin-dupuis closed 5 years ago

benjamin-dupuis commented 5 years ago

The function clipped_error is not correctly written. Indeed, the try and except parts are the same ! Currently, it is written as :

def clipped_error(x): try: return tf.select(tf.abs(x) < 1.0, 0.5 tf.square(x), tf.abs(x) - 0.5) except: return tf.where(tf.abs(x) < 1.0, 0.5 tf.square(x), tf.abs(x) - 0.5)

The function should be

def clipped_error(x): return tf.where(tf.abs(x) < 1.0, 0.5 * tf.square(x), tf.abs(x) - 0.5)