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

Add attentive layer to Jepa #927

Merged
merged 40 commits into from
Dec 27, 2024
Merged

Conversation

antoine-tran
Copy link
Contributor

@antoine-tran antoine-tran commented Dec 19, 2024

What does this PR do? Please describe:

This PR follows up #889 to add the building blocks (models, builders, loader) for the finetuned JEPA encoder, plus testing scripts of the models in different downstream tasks.

Does your PR introduce any breaking changes? If yes, please list them:
List of all backwards-incompatible changes.

Check list:

  • Was the content of this PR discussed and approved via a GitHub issue? (no need for typos or documentation improvements)
  • Did you read the contributor guideline?
  • Did you make sure that your PR does only one thing instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests?
  • Did you verify new and existing tests pass locally with your changes?
  • Did you update the CHANGELOG? (no need for typos, documentation, or minor internal changes)

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 19, 2024
@antoine-tran antoine-tran changed the title Tuan/add attentive layer to jepa Add attentive layer to jepa Dec 19, 2024
@antoine-tran antoine-tran marked this pull request as ready for review December 20, 2024 12:58
@antoine-tran antoine-tran changed the base branch from main to tuan/support_explicit_init_fn December 20, 2024 12:59
@antoine-tran antoine-tran changed the title Add attentive layer to jepa Add attentive layer to Jepa Dec 20, 2024
Tuan Tran added 2 commits December 20, 2024 13:46
@cbalioglu
Copy link
Contributor

I am outside for a couple errands, will review before EOD.

Base automatically changed from tuan/support_explicit_init_fn to main December 20, 2024 21:07
def forward(
self, seqs: Tensor, padding_mask: PaddingMask | None
) -> tuple[Tensor, PaddingMask | None]:
if self.encoder:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure that this forward implementation is accurate? In the reference implementation here, I see that encoder stack is applied after cross attention which is the reverse of what we have here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the internal code seems to deviate from this

Copy link
Contributor

@cbalioglu cbalioglu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@cbalioglu cbalioglu merged commit 47fd523 into main Dec 27, 2024
15 checks passed
@cbalioglu cbalioglu deleted the tuan/add_attentive_layer_to_jepa branch December 27, 2024 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants