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

Train speech language ID classification head #450

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

Conversation

am831
Copy link
Contributor

@am831 am831 commented May 9, 2024

Implements a new training script for training a classification head. The new nn.module in model.py is separate from other components of M4T and takes speech encoder output and maps it into language probabilities with softmax. All layers of M4T are frozen to prevent training of those components. A new dataset.py script is implemented for downloading common voice from hugging face.

Most recent results from training:

Samples in train dataset:

- eng - 647 samples
- fra - 676 samples
- deu - 862 samples
- rus - 775 samples
- spa - 908 samples
- hin - 418 samples
- Total - 4286 samples

Samples in eval dataset:

- eng - 394 samples
- fra - 289 samples
- deu - 363 samples
- rus - 356 samples
- spa - 408 samples
- hin - 239 samples
- Total - 2049 samples

Parameters:

- batch_size 32
- learning_rate .001
- patience 10
- num_layers 4

441325260_8377882475560539_6518711659633650790_n

I am collaborating with @zrthxn on this project

@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 May 9, 2024

grad_scaler = torch.cuda.amp.GradScaler()
optimizer = AdamW(
params=frozen_model.parameters(),
Copy link
Contributor

Choose a reason for hiding this comment

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

We want to optimize the head not the frozen model

zrthxn and others added 11 commits May 11, 2024 00:07
* Dataloader

* Training loop fixes

* One Hot encode language labels

* Remove `dist_utils`

* Remove duplicate option

* remove label smoothing

* Device class

* Batching

* Add float_dtype

* Add padding mask

* Add padding mask

* Device

* Model shape

* Optimize head
* Small fixes

* Argyment

* Batch size

* Model shape

* unsqueeze

* Long

* Float tensor

* Float tensor

* DEvice

* While set

* src_lengths

* Refactor
@am831 am831 marked this pull request as ready for review June 1, 2024 18:51
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.

4 participants