SpringerNLP / Chapter10

Chapter 10: Multi-task Learning
7 stars 3 forks source link

Excuse me,why accuracy1, accuracy2 Is 0 #2

Open tanglixin0223 opened 5 years ago

tanglixin0223 commented 5 years ago

accuracy1 = torch.sum(pred1.squeeze(2) == y_vals[0].data) / (y_vals[0].size(0) y_vals[0].size(1)) accuracy2 = torch.sum(pred2.squeeze(2) == y_vals[1].data) / (y_vals[1].size(0) y_vals[1].size(1)) accuracy = (accuracy1, accuracy2) Excuse me,why accuracy1, accuracy2 Is 0

antgr commented 5 years ago

Hi I have a fix for that, I will try to come back with a pull request. You can check my code here https://github.com/antgr/nlp_multi_task_learning_pytorch If you or anybody else can make my fix more elegant please provide your suggestions or join me on the github.