A more than 1000X faster paralleled LSTM-CRF implementation modified from the slower version in the Pytorch official tutorial (URL:https://pytorch.org/tutorials/beginner/nlp/advanced_tutorial.html).
Thanks to your code.
I trained a NER model with LSTM_CRF_faster_parallel.py. During the trainning, the loss values could be negetive in some steps. So I changed the loss into
torch.sum(torch.abs(forward_score - gold_score))/batch_size.
Then the loss values were all positive and the model was better fitting with my data.
Thanks to your code. I trained a NER model with LSTM_CRF_faster_parallel.py. During the trainning, the loss values could be negetive in some steps. So I changed the loss into torch.sum(torch.abs(forward_score - gold_score))/batch_size. Then the loss values were all positive and the model was better fitting with my data.