lstm的输出形状(batch,seq_len, hidden_size*2)

因为要接fc,所以使用out=out[:,-1,:],将seq_len这个维度去掉了。

[bert+rnn] pytorch中降维的骚操作:out = out[:,-1,:]

得到形状(batch,hidden_size*2)

[bert+rnn] pytorch中降维的骚操作:out = out[:,-1,:]

经过fc后,最终得到形状(batch,class_nums)

[bert+rnn] pytorch中降维的骚操作:out = out[:,-1,:]

相关文章:

  • 2021-12-01
  • 2022-01-20
  • 2022-12-23
  • 2022-12-23
  • 2021-08-29
  • 2022-12-23
猜你喜欢
  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-29
  • 2021-11-16
  • 2022-12-23
相关资源
相似解决方案