Skip to content

MingLunHan/CIF-PyTorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CIF-PyTorch

A PyTorch Implementation of the Continuous Integrate-and-Fire (CIF) Module for End-to-End ASR

Paper Framework License

🚀 Attention! Please refer to CIF-HieraDist for our latest and complete implementation of the CIF-based speech recognition model!

This repository provides a PyTorch implementation of the Continuous Integrate-and-Fire (CIF) module for end-to-end (E2E) automatic speech recognition (ASR), originally proposed in CIF: Continuous Integrate-and-Fire for End-to-End Speech Recognition.

📧 If you have any questions, feel free to contact me at hanminglun1996@foxmail.com.


Table of Contents


1. A Feasible Configuration for the CIF Module

encoder_embed_dim: 256          # should be the innermost dimension of inputs
produce_weight_type: "conv"
cif_threshold: 0.99
conv_cif_layer_num: 1
conv_cif_width: 3               # or 5
conv_cif_output_channels_num: 256
conv_cif_dropout: 0.1
dense_cif_units_num: 256
apply_scaling: True
apply_tail_handling: True
tail_handling_firing_threshold: 0.5
add_cif_ctxt_layers: False

2. Tips

  1. Down-sampling. For speech recognition, we usually down-sample the input frame sequence to 1/8 of its length on the encoder side to ensure efficient training of the CIF module. For other tasks, keep the length difference between the CIF input and output within a reasonable range.
  2. Length alignment. During training, when the scaled sum of the weights differs from the length of the reference transcription, truncate the reference and the model output to the same length.
  3. Avoiding gradient explosion. The scaling strategy during training may cause gradient explosion, since computing the normalization scalar involves a division. Add a small value (1e-8) to the denominator to avoid this problem.

3. Other CIF Research Work and Resources

a. Papers

b. Repositories

  • CIF-PyTorch — A PyTorch implementation of a standalone CIF module.
  • torch_cif — A faster PyTorch implementation of CIF.
  • CIF-ColDec — CIF-based Contextualization and Collaborative Decoding (ColDec).
  • w2v-cif-bert — CIF as a bridge connecting pre-trained acoustic models and pre-trained language models.
  • CIF-HieraDist — The official implementation of Hierarchical Knowledge Distillation (HieraDist) for CIF-based models.

⭐ If you find this repository helpful, please consider giving it a star.

About

[ICASSP 2020] CIF: Continuous Integrate-and-Fire for End-to-End Speech Recognition (A PyTorch implementation of Continuous Integrate-and-Fire mechanism).

Topics

Resources

License

Security policy

Stars

78 stars

Watchers

3 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages