jiesutd / LatticeLSTM

Chinese NER using Lattice LSTM. Code for ACL 2018 paper.
1.79k stars 457 forks source link

模型怎么用GPU,需要改几处? #38

Closed zxy951005 closed 5 years ago

zxy951005 commented 5 years ago

gpu=True,但是也没用GPU, 哪儿需要改动,model后面加个cuda()就完了吗?还是还有其他也要改。

jiesutd commented 5 years ago

In default, it will use gpu when the system detects the gpu.

https://github.com/jiesutd/LatticeLSTM/blob/3f960348ea07b065afff653949046f09470332f4/main.py#L395

zxy951005 commented 5 years ago

没用上batch所以速度好慢啊,训练一天才8个epoch > _ < 。谢谢作者,回复好快。

Kiwisher commented 5 years ago

I am a little bit confused why can't it use batch during training..?

jiesutd commented 5 years ago

I am a little bit confused why can't it use batch during training..?

Because it is hard to implement the real batched lattice LSTM, as each input has a different shortcut link. The batched version is possible, but it is a little complicated.

songtaoshi commented 5 years ago

does the batched version meaning we should padding inner padding?