-
Notifications
You must be signed in to change notification settings - Fork 528
Description
Describe the bug
- Whenever greenkhorn is called with log=True, the algorithm will return error.
- greenkhorn does not allow for list input (I have to convert a, b, M as np.array manually), while sinkhorn_knopp does (in sinkhorn_knopp, the first three lines of code convert list to np.asarray).
To Reproduce
Steps to reproduce the behavior:
- a = [.5, .5]
b = [.5, .5]
M = [[0., 1.], [1., 0.]] - a, b, M = np.array(a), np.array(b), np.array(M)
(greenkhorn will not allow list object, and have to convert manually) - T, log = ot.bregman.greenkhorn(a, b, M, 0.001, log=True)
(this line encounters error)
Expected behavior
It seems that I can never return the log dictionary using greenkhorn, and I am not sure why.
When running original sinkhorn, the log argument works fine.
Besides, I hope greenkhorn could allow for list as input (this is not an bug, but maybe it could be added in the future).
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: MacOSX
- Python version [2.7,3.6]: 3.6
- How was POT installed [source, pip, conda]: conda
Output of the following code snippet:
import platform; print(platform.platform())
import sys; print("Python", sys.version)
import numpy; print("NumPy", numpy.__version__)
import scipy; print("SciPy", scipy.__version__)
import ot; print("POT", ot.__version__)
import platform; print(platform.platform())
Darwin-18.2.0-x86_64-i386-64bit
import sys; print("Python", sys.version)
Python 3.6.7 |Anaconda custom (64-bit)| (default, Oct 23 2018, 14:01:38)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)]
import numpy; print("NumPy", numpy.version)
NumPy 1.15.4
import scipy; print("SciPy", scipy.version)
SciPy 1.1.0
import ot; print("POT", ot.version)
POT 0.5.1
Additional context
Add any other context about the problem here.