Reputation: 637
Some of the tensorflow functions are only differentiable by some of the arguments.
I want to know if tf.pow(x, y) is differentiable by y? (I am pretty sure it is differentiable by x.)
Thanks!
Upvotes: 1
Views: 76
Reputation: 840
Yes, tf.pow(x, y)
is differentiable by y in tensorflow.
You can test the following scenario.
x = tf.Variable(3.0)
y = tf.Variable(3.0)
with tf.GradientTape() as tape:
z = tf.pow(x, y)
dz_dy = tape.gradient(z, y)
dz/dy
is (x^y)*log(x)
so we should get a value of (3^3)*(log(3))
which is exactly what we see with tf
dz_dy.numpy() = 29.662533
Upvotes: 3