wenwenyu / PICK-pytorch

Code for the paper "PICK: Processing Key Information Extraction from Documents using Improved Graph Learning-Convolutional Networks" (ICPR 2020)
https://arxiv.org/abs/2004.07464
MIT License
556 stars 193 forks source link

Minor edit to logic #17

Closed chenxing1999 closed 4 years ago

chenxing1999 commented 4 years ago

I think here you want to escape divide by 0 error :))) Thank you for your source code. Here just a minor edit from me to make code look better.

wenwenyu commented 4 years ago

@xing1999 Thanks for your advice. But the aim is not to escape divide by 0 error in soft_adj = soft_adj / sum_out + 1e-10. Because sum_out cannot be zero dut to soft_adj > 0 after exponential operation. The real aim of adding 1e-10 is to avoid soft_adj / sum_out is all close to zero.