Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter updating by novel view synthesis #10

Closed
juanilarregui opened this issue Jun 22, 2017 · 4 comments
Closed

Parameter updating by novel view synthesis #10

juanilarregui opened this issue Jun 22, 2017 · 4 comments

Comments

@juanilarregui
Copy link

Hi @tinghuiz,

The method _interpolate in file utils.py samples pixels in the source image with tf.gather, given the indices computed from intrinsics matrices and depth. The gradient of tf.gather is not computed w.r.t. the indices, so backpropagation does not reach the tensor of the computed depth (or, similarly, the pose). So,

How does the network update the depth (pose) parameters? Am I missing something in the analysis?

Cheers.

@tinghuiz
Copy link
Owner

Oh, why do you think the gradients cannot backprop through tf.gather? FYI, I copied the _interpolate method from the official tensorflow repo: https://github.com/tensorflow/models/blob/master/transformer/spatial_transformer.py.

@juanilarregui
Copy link
Author

Sorry, now I understand: the gradient is backpropagated to depth and pose through the calculated weights wa, wb, wc, wd, not through the indices idx_a, idx_b, idx_c, idx_d, i.e., through the interpolation. Of course, for each sampled pixel, the net decides "where to move" in the grid only looking at the four neighbouring pixels used in the interpolation, but not beyond those pixels. So:

Am I wrong if I think that the optimization works because the baseline between consecutive frames is small? I mean, if the baseline were greater, the optimization wouldn't work, right?

Cheers!

@tinghuiz
Copy link
Owner

You are right that the gradients for depth and pose are backproped through the w's, and the gradient can only be derived from the four neighboring pixels used in the interpolation, which is why we use a multi-scale loss and depth smoothness loss in the objective to overcome the gradient locality (see Sec. 3.4 of the paper). With multi-scale and smoothness, the system is able to deal with reasonably large baselines.

@juanilarregui
Copy link
Author

Oh, I didn't take that into account. Thank you very much for the explanation and for sharing your code!

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants