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

dpc implementation #40

Open
ReactiveCJ opened this issue May 28, 2024 · 1 comment
Open

dpc implementation #40

ReactiveCJ opened this issue May 28, 2024 · 1 comment

Comments

@ReactiveCJ
Copy link

ReactiveCJ commented May 28, 2024

In the implementation of dpc algorithm, for code of this line,
as we know the size of dist_matrix is B N N, because we want to get the max distance of each token, but if we flat the dist_matrix, we will only get the max distance of each batch.
dist_max = dist_matrix.flatten(1).max(dim=-1)[0][:, None, None]

we can change the code to
dist_max = dist_matrix.max(dim=-1)[0][:, :, None]

@ReactiveCJ ReactiveCJ changed the title dcp implementation dpc implementation May 28, 2024
@jpthu17
Copy link
Member

jpthu17 commented May 28, 2024

Thanks for your code. I'll go over my previous code tomorrow.

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