How to apply gradients later in tensorflow
Clash Royale CLAN TAG #URR8PPP How to apply gradients later in tensorflow I have a model where I computed the gradients manually over multiple examples. I have added the gradients manually, and now would like to do back propagation in tensorflow through: prev_accum_grads = [tf.placeholder_with_default(input=tf.zeros(shape=var.get_shape().as_list(), dtype=m_dtype), shape=var.get_shape().as_list(), name=var.name[:-2] + "_accum_grads") for var in tf.trainable_variables()] grads_and_vars = list(zip(prev_accum_grads, tf.trainable_variables())) train_step = optimizer.apply_gradients(grads_and_vars) Now, given the calculated gradients in prev_g[0], prev_g[1] ... prev_g[9] as in the code below; and would like to apply the gradients as: prev_g[0], prev_g[1] ... prev_g[9] # prev_g is a list holding the values of the gradients. feed_dict = { prev_accum_grads[0]: prev_g[0], prev_accum_grads[1]: prev_g[1], pre...