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

Conv1d subsampling #7294

Merged
merged 5 commits into from
Aug 24, 2023
Merged

Conv1d subsampling #7294

merged 5 commits into from
Aug 24, 2023

Conversation

burchim
Copy link
Contributor

@burchim burchim commented Aug 22, 2023

What does this PR do ?

Add conv1d subsampling for ASR

Collection: asr

Changelog

  • Add 'striding_conv1d' and 'dw_striding_conv1d' subsampling options. Subsampling is performed using strided conv1d convolutions with kernel size 5 instead of doing reshape + frequency-temporal conv2d + reshape + linear projection.

Usage

  • Simply use 'subsampling: striding_conv1d in conformer yaml config for example.
  encoder:
      _target_: nemo.collections.asr.modules.ConformerEncoder
      feat_in: ${model.video_front_end.dim_output}
      feat_out: -1 # you may set it if you need different output size other than the default d_model
      n_layers: 18
      d_model: 512
  
      # Sub-sampling params
      subsampling: striding_conv1d # vggnet, striding, stacking or stacking_norm, dw_striding, striding_conv1d_k5, dw_striding_conv1d
      subsampling_factor: 8 # must be power of 2 for striding and vggne
...

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

PR Type:

  • New Feature
  • Bugfix
  • Documentation

If you haven't finished some of the above items you can still open "Draft" PR.

Who can review?

Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.

Additional Information

  • Related to # (issue)

burchim and others added 4 commits August 21, 2023 14:36
change striding_conv1d_k5 to striding_conv1d

Signed-off-by: Maxime Burchi <[email protected]>
@github-actions github-actions bot added the ASR label Aug 22, 2023
Copy link
Collaborator

@titu1994 titu1994 left a comment

Choose a reason for hiding this comment

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

Looks ok to me, @nithinraok fyi

@titu1994 titu1994 merged commit 4cda824 into NVIDIA:main Aug 24, 2023
11 checks passed
rohitrango pushed a commit to rohitrango/NeMo that referenced this pull request Jun 25, 2024
* striding_conv1d_k5 and dw_striding_conv1d_k5 subsampling

Signed-off-by: mburchi <[email protected]>

* transpose conv1d inputs

Signed-off-by: mburchi <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Signed-off-by: mburchi <[email protected]>

* Update subsampling.py

change striding_conv1d_k5 to striding_conv1d

Signed-off-by: Maxime Burchi <[email protected]>

---------

Signed-off-by: mburchi <[email protected]>
Signed-off-by: Maxime Burchi <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Somshubra Majumdar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants