tensorflow - Optimizing a subset of a tensor in Tensor Flow -


i have free varaible (tf.variable) x, , wish minimize error term respect subset of tensor x (for example minimizing error respect first row of 2d tensor).

one way compute gradients , change gradient 0 irrelevant parts of tensor , apply gradients. way?

you can use mask , tf.stop_gradient selectively make variable non-trainable: tf.stop_gradient(mask*x). value in matrix mask 1 should denote parts apply gradient , 0 otherwise.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -