Open Sibo-tao opened 6 years ago
I think it is the way to reinforce straight through estimator because tf.clip_by_value happens to zero out out gradients for x out of bound.
I have the same question. The tf.clip_by_value seems to be redundant before tf.sign.
I do not understand why there are two lines of codes in binarize(x):
x=tf.clip_by_value(x,-1,1)
return tf.sign(x)
because clipping will not change the sign of x. Why we need the first line?