-
Notifications
You must be signed in to change notification settings - Fork 529
Description
Describe the bug
When I call entropic_fused_gromov_barycenters
, I have the following error :
ValueError: shapes (10,1) and (10,1) not aligned: 1 (dim 1) != 10 (dim 0)
Screenshots

Code sample
n = 10
g1 = nx.erdos_renyi_graph(n,0.5)
g2 = nx.erdos_renyi_graph(n,0.5)
c1 = nx.adjacency_matrix(g1).toarray().astype(np.float64)
c2 = nx.adjacency_matrix(g2).toarray().astype(np.float64)
y = [[[1]]*n]*n
y = np.array(y).astype(np.float64)
f , c = fgw_barycenters(n,y,[c1,c2],alpha=0.5 )
f , c = entropic_fused_gromov_barycenters(n,y,[c1,c2],alpha=0.5)
print(c)
print(f)
Expected behavior
entropic_fused_gromov_barycenters
should act like fgw_barycenters
.
Environment (please complete the following information):
- OS (e.g. MacOS, Windows, Linux): MacOS
- Python version:
- How was POT installed (source,
pip
,conda
):pip
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__)
macOS-12.5.1-arm64-arm-64bit
Python 3.11.5 (main, Aug 24 2023, 15:09:32) [Clang 14.0.0 (clang-1400.0.29.202)]
NumPy 1.26.0
SciPy 1.11.3
POT 0.9.1
Additional context
I think the cause of the problem is in lines 986,987 in _bregman.py
Y = update_feature_matrix(lambdas, Ys_temp, T_temp, p)
Ms = [dist(Ys[s], Y) for s in range(len(Ys))]
dist
takes entries in the form (ns,d)
where update_feature_matrix
returns ouputs of dimension (d,n)
. Either a transpose of Y or a change or the output type of update_feature_matrix would solve it.
I wanted to do a pr to fix but I could not run the test locally. Do you just make test
?
this is the error I encounter when I do that :