How to compute gradients with tf.scatter_sub?
问题 When implementing lambda-opt(an algorithm published on KDD'19) in tensorflow, I came across a problem to compute gradients with tf.scatter_sub 。 θ refers to an embedding matrix for docid. The formulation is θ(t+1)=θ(t) - α*(grad+2*λ*θ), delta = theta_grad_no_reg.values * lr + 2 * lr * cur_scale * cur_theta next_theta_tensor = tf.scatter_sub(theta,theta_grad_no_reg.indices,delta) then I use θ(t+1) for some computation. Finally, I want to compute gradients with respect to λ, not θ. But the