You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am implementing a CT reconstruction algorithm using a deep neural network. As part of my algorithm, I need to compute forward mode and reverse mode gradients of the forward operator (ray-transform in this case). I am using the 'as_tensorflow_layer' to make the odl operator as part of the graph.
works fine. I am not sure why doesn't the self.measure_grads work.
I am also unable to compute the forward mode gradients for the odl tensorflow layers. The forward mode gradients can be computed in tensorflow using the following algorithm.
def fwd_gradients(ys, xs, d_xs):
"""Forward-mode pushforward analogous to the pullback defined by tf.gradients.
With tf.gradients, grad_ys is the tensor being pulled back, and here d_xs is
the tensor being pushed forward."""
v = tf.ones(shape=ys.shape, dtype=ys.dtype)
#v = tf.placeholder_with_default(v0, shape=ys.get_shape()) # dummy variable
#v = tf.placeholder(ys.dtype, shape=ys.get_shape())
g = tf.gradients(ys, xs, grad_ys=v)
return tf.gradients(g, v, grad_ys=d_xs)[0]
It works well for all the other standard tf layers. However for odl tf layers, it give None.
The text was updated successfully, but these errors were encountered:
I am implementing a CT reconstruction algorithm using a deep neural network. As part of my algorithm, I need to compute forward mode and reverse mode gradients of the forward operator (ray-transform in this case). I am using the 'as_tensorflow_layer' to make the odl operator as part of the graph.
On computing the reverse mode gradients
I get the following error:
However,
works fine. I am not sure why doesn't the self.measure_grads work.
I am also unable to compute the forward mode gradients for the odl tensorflow layers. The forward mode gradients can be computed in tensorflow using the following algorithm.
It works well for all the other standard tf layers. However for odl tf layers, it give None.
The text was updated successfully, but these errors were encountered: