flashlight / flashlight

A C++ standalone library for machine learning
https://fl.readthedocs.io/en/latest/
MIT License
5.3k stars 497 forks source link

[Changing Hyper Parameters of Conformer Model] #763

Open harisgulzar1 opened 3 years ago

harisgulzar1 commented 3 years ago

Question

I want to train conformer model from scratch but after tweaking some hyperparameters (to make the model smaller) i.e. reducing the convolutional layers etc.

In the ASR finetuning tutorial, it uses the model architecture file which I don't find in repository. How can I train a new model architecture or change an existing one before training?

Additional Context

For example in ASR finetuning tutorial Link:

https://github.com/EnricoASchmitz/flashlight_2/tree/722132844f1c4ecb92713eea8322ea1d5e9eff73/flashlight/app/asr/tutorial

It directly downloads the predefined model parameters and architecture files. !wget -nv --continue -o /dev/null https://dl.fbaipublicfiles.com/wav2letter/rasr/tutorial/am_transformer_ctc_stride3_letters_70Mparams.bin -O model.bin # acoustic model !wget -nv --continue -o /dev/null https://dl.fbaipublicfiles.com/wav2letter/rasr/tutorial/am_transformer_ctc_stride3_letters_70Mparams.arch -O arch.txt # model architecture file

Is there any way to modify these files? Or is there any other approach which I should follow? Thanks.

joazoa commented 3 years ago

You can find the model here and some alternatives.

https://github.com/flashlight/wav2letter/tree/main/recipes/rasr You can modify the file, but you will need to retrain from scratch.

They did not provide the training configuration for these files, but you can have an idea by opening the .bin file in an editor, the configuration is stored in plaintext.

You can get another example here for transformer CTC training here: https://github.com/flashlight/wav2letter/blob/main/recipes/sota/2019/librivox/train_am_transformer_ctc.cfg