|
WH_data[WH_data == 0] = EPSILON |
The line WH_data[WH_data == 0] = ΕPSILON as part of the β loss calculation creates a situation where some entries in the data that were larger than other (say 1E-09 was larger than zero) are now smaller than the other.
I think the code should be corrected to
WH_data[WH_data < EPSILON] = ΕPSILON
to avoid such inconsistencies.
Another issue is preventing overflows in the devision that happens a few lines later - if the data has the smallest positive number (around 10^-38), dividing a number larger than 1 by it causes the overflow.
scikit-learn/sklearn/decomposition/_nmf.py
Line 143 in 3f82f84
The line
WH_data[WH_data == 0] = ΕPSILONas part of the β loss calculation creates a situation where some entries in the data that were larger than other (say 1E-09 was larger than zero) are now smaller than the other.I think the code should be corrected to
WH_data[WH_data < EPSILON] = ΕPSILONto avoid such inconsistencies.
Another issue is preventing overflows in the devision that happens a few lines later - if the data has the smallest positive number (around 10^-38), dividing a number larger than 1 by it causes the overflow.