iesl / box-embeddings

Box Embeddings as Modules
https://www.iesl.cs.umass.edu/box-embeddings
Apache License 2.0
100 stars 10 forks source link

Denominator in bag of boxes pooler can be zero. #14

Closed dhruvdcoder closed 3 years ago

dhruvdcoder commented 3 years ago

The denominator can be zero and result in NaN output. Adding a small epsilon will help.

https://github.com/iesl/box-embeddings/blob/444e3e8f5b19b7d64ef41b2ca7cbc400365c3843/box_embeddings/modules/pooling/bag_of_boxes.py#L23