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

What does I * (1 - valid_inds) mean? #3

Open
JayChan-USTC opened this issue Nov 21, 2022 · 1 comment
Open

What does I * (1 - valid_inds) mean? #3

JayChan-USTC opened this issue Nov 21, 2022 · 1 comment

Comments

@JayChan-USTC
Copy link

JayChan-USTC commented Nov 21, 2022

hi,author!
During training, when calculating A, the following formula is used,
A = torch.matmul(prev_sim_map, A) * valid_inds + I * (1 - valid_inds)
A = A * valid_inds + I * (1 - valid_inds).

https://github.com/TRI-ML/RAM/blob/master/src/lib/model/networks/base_model.py#:~:text=if%20prev_sim_map%20is%20not%20None,A%20*%20valid_inds%20%2B%20I%20*%20(1%20-%20valid_inds)
(line 334-line 342)

I have two questions,
(1) I don't know what I * (1 - valid_inds) means,
(2) Why need to add I * (1 - valid_inds) after calculating (torch.matmul(prev_sim_map, A) * valid_inds) and (A * valid_inds)

Hope to get your reply, thank you!

@Wuziyi616
Copy link

Wuziyi616 commented Jun 1, 2023

I think if they don't add I * (1 - valid_inds), then some rows in A will be all-zeros, which will lead to divide-by-error in later lines. I don't think that's important tho. After all, the invalid tracks should never be used in loss computation.

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