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

question about the score matrix for optimal transportation #127

Open
why-scholar opened this issue Nov 22, 2022 · 2 comments
Open

question about the score matrix for optimal transportation #127

why-scholar opened this issue Nov 22, 2022 · 2 comments

Comments

@why-scholar
Copy link

Equation 7 computes the score matrix through the inner product of two vectors, which may cause the score matrix to contain negative values. (1) One of my questions is whether negative values in score matrix have effect in optimal transportation? (2) The values computed based on inner product mean that large values indicate similar keypoints, while small values indicate dissimilar keypoints. However, the sinkhorn algorithm searches the lowest cost for optimal transportation problem. If large values in score matrix indicate better matching performance, it is contradictory with optimal transportation problem. This confuses me a lot, and its my pleasure if you can explain it.

@sarlinpe
Copy link
Contributor

$\bar{\mathbf{S}}$ (eq 7 & 8) corresponds to the scores of the optimal transport in log space. The scores of the classical problem are $\exp(\bar{\mathbf{S}})$. See the code for reference:

scores = torch.einsum('bdn,bdm->bnm', mdesc0, mdesc1)
scores = scores / self.config['descriptor_dim']**.5
# Run the optimal transport.
scores = log_optimal_transport(
scores, self.bin_score,
iters=self.config['sinkhorn_iterations'])

@why-scholar
Copy link
Author

Thanks for your reply. I am still confused about the two mentioned problems. In my opinion, the computation of optimal transport in the log space is not proposed to deal with negative values in the score matrix. In addition, the question about the inner product also confuses me.

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