songyingxin / Bert-TextClassification

Implemention some Baseline Model upon Bert for Text Classification
Other
683 stars 149 forks source link

dpcnn在进行全连接的时候模型输入尺寸出错 #12

Open FOXaaFOX opened 4 years ago

FOXaaFOX commented 4 years ago

x = x.squeeze()

x: [batch_size, filter_num]

change:

x = x.view(batch_size, 2*filter_num)

x: [batch_size,2* filter_num]

gWeiXP commented 1 year ago

dpccn这个模型,max_seq_length不能是任意数。 不然经过self._block(x)这个模块后,得到的形状不是[batch_size, filter_num],而是[batch_size, filter_num, 2] max_seq_length设置成,减2后,不断除2,得到的结果是1不是2,就行。