Skip to content

Add BestRQ pretraining #873

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

jc-audet
Copy link
Contributor

@jc-audet jc-audet commented Dec 6, 2024

What does this PR do? Please describe:
This is a draft implementation of the BestRQ algorithm from https://arxiv.org/pdf/2202.01855

Fixes #{issue number}

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 6, 2024
@jc-audet jc-audet marked this pull request as ready for review January 13, 2025 19:59
@jc-audet jc-audet requested a review from cbalioglu as a code owner January 13, 2025 19:59
@final
@dataclass
class BestRQOutput:
"""Holds the output of a w2v-BERT model."""
Copy link
Contributor

Choose a reason for hiding this comment

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

w2v-BERT -> BestRQ

@final
@dataclass
class BestRQLoss:
"""Holds the loss of a w2v-BERT model."""
Copy link
Contributor

Choose a reason for hiding this comment

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

w2v-BERT -> BestRQ

spatial_span_len: int = 10,
max_spatial_mask_prob: float = 0.0,
min_num_spatial_mask_spans: int = 2,
mask_overlap_strategy: str = "no", # remove_masks (fs2 default), add_masks_jc (additive, v1), add_masks_mike (additive, v2), roll (Alex's suggestion)
Copy link
Contributor

Choose a reason for hiding this comment

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

The comment here is not useful for people outside of Arrival. Could you add more descriptions on what each strategy does?

spatial_mask_span_len: int = 10
"""The length of each spatial mask span that is applied over features."""

max_spatial_mask_prob: float = 0.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add "Best-RQ does not have spatial masking during pre-training, and spatial masking is only used optionally during ASR fine-tuning to mimic SpecAugment."?

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