richliao / textClassifier

Text classifier for Hierarchical Attention Networks for Document Classification
Apache License 2.0
1.07k stars 379 forks source link

NaN Loss Function #8

Closed Helw150 closed 7 years ago

Helw150 commented 7 years ago

I am attempting to classify relatively large documents using HAN (~800 lines). Currently, I am experiencing NaN loss from the first epoch, and I am struggling to debug it appropriately. The Google Groups page for this method discusses issues with masking, but as I understand this implementation should have no issues with that. Any reccomendations for debugging this loss overflow?

Helw150 commented 7 years ago

I've tracked the issue down to inputs which are shorter than the maximum number of lines. Lines that are entirely zero seem to cause NaN loss.