Reputation: 94
I have a tensorflow graph already set, an input variable (x = tf.Variable() ) and the resulting error term (err). I would like to be able to update on a subset of the elements in x.
One way is using tf.stop_gradient(), however this will require rebuilding the graph again from scratch apply the stop gradient operator. Is their a way to do this without having to go through rebuilding the graph.
Upvotes: 0
Views: 189
Reputation: 24651
If you can't rebuild the graph, a solution could be to save values of x
prior to the update, and later to tf.assign
those values back to the elements of x
that you want to preserve.
Upvotes: 1