http://zh-v2.d2l.ai/chapter_natural-language-processing-applications/sentiment-analysis-cnn.html
![]()
这个地方说是用最大池化,但是用成平均的了
3 Likes

作者的cnn结果也是过拟合,应该怎么修改呢?
对比了最大汇聚和平均汇聚,最大汇聚效果更好写,7个epoch下test acc 0.871
seems worse in case max pooling for me
some questions:
- in currently , both rnn and cnn solutions are poor.what’s the root cause? pertained model?
- I cut the classifier head in this model , then uses it to do compare ‘sentences similarity’ , it works.
原始输入序列形状为(batch, seq_len),经过嵌入层后形状为(batch, seq_len, embed_size),然后把embed_size这一维当成通道,所以对最后两个维度转置,形状变为(batch, embed_size, seq_len),现在上面说d维向量表示的n个词元,也就是seq_len=n,embed_szie=d,所以输入通道就是d了

