rajewsky-lab / novosparc

BSD 3-Clause "New" or "Revised" License
125 stars 41 forks source link

division by zero error 'sinkhorn' optimization #50

Open zoepiran opened 3 years ago

zoepiran commented 3 years ago

Performing reconstruction with marker genes and initializing with a low epsilon (5e-4; currently the default value) tends to raise one (or both) of the following warnings: /usr/local/lib/python3.7/dist-packages/ot/bregman.py:363: RuntimeWarning: divide by zero encountered in true_divide v = np.divide(b, KtransposeU) /usr/local/lib/python3.7/dist-packages/ot/bregman.py:363: RuntimeWarning: overflow encountered in true_divide v = np.divide(b, KtransposeU)

A "fix" around is initializing with a higher value (5e-3). A more elaborate change can be done in the normalization of the two objectives (the GW term and the atlas term) ensuring both are in the same order of magnitude.

Reproducing the error can be done over the Drosophila data ('reconstruct_drosophila_embryo_tutorial.ipynb') running "Reconstruct the tissue with marker genes" with epsilon = 5e-4.