cs230-stanford / cs230-code-examples

Code examples in pyTorch and Tensorflow for CS230
Other
3.79k stars 984 forks source link

forget about masking when compute accuracy #13

Open yinxusen opened 6 years ago

yinxusen commented 6 years ago

https://github.com/cs230-stanford/cs230-code-examples/blob/159df10a6187c7e1d6ec949c8e06d7f67f8f1cd2/tensorflow/nlp/model/model_fn.py#L68

The computation of accuracy and the metrics of accuracy below are lack of masking. In this way the accuracy could be wrong because of wrong predictions of padded tokens.