649453932 / Chinese-Text-Classification-Pytorch

中文文本分类,TextCNN,TextRNN,FastText,TextRCNN,BiLSTM_Attention,DPCNN,Transformer,基于pytorch,开箱即用。
MIT License
5.33k stars 1.23k forks source link

why do you set " padding_idx=config.n_vocab - 1" in TextCnn instead of "padding_idx=0"? #9

Closed BUAAChuanWang closed 4 years ago

649453932 commented 4 years ago

padding_idx (int, optional) – If given, pads the output with the embedding vector at padding_idx (initialized to zeros) whenever it encounters the index.