You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But there may be some bugs with the distance matrices C1 and C2. I tried a graph in the dataset BZR, and some entries in C1 seem to be not correct.
Here are the codes.
importnumpyasnpimportos,syssys.path.append(os.path.realpath('../lib'))fromgraphimportgraph_colors,draw_rel,draw_transp,Graph,wl_labelingfromot_distancesimportFused_Gromov_Wasserstein_distance,Wasserstein_distanceimportcopyfromdata_loaderimportload_local_data,histog,build_noisy_circular_graphimportmatplotlib.pyplotaspltimportnetworkxasnximportotdataset_n='bzr'path='../data/'X,label=load_local_data(path,dataset_n,wl=0)G1=X[0]g1=G1.nx_graphG2=copy.deepcopy(G1)vmin=-5vmax=20# the range of colorplt.figure(figsize=(8,5))draw_rel(g1,vmin=vmin,vmax=vmax,with_labels=True,draw=False)dgw=Fused_Gromov_Wasserstein_distance(alpha=1,features_metric='hamming_dist',method='shortest_path').graph_d(G1,G2)
The graph G1 I get is
I also slightly changed the following two lines to draw this graph properly.
Thanks for this great package for FGW!
But there may be some bugs with the distance matrices C1 and C2. I tried a graph in the dataset BZR, and some entries in C1 seem to be not correct.
Here are the codes.
The graph G1 I get is
I also slightly changed the following two lines to draw this graph properly.
FGW/lib/graph.py
Line 355 in 3d2128a
FGW/lib/graph.py
Line 379 in 3d2128a
Change them to:
and
The distance matrix (30 * 30) of this graph can be checked. The first line of it is:
where the third entry "1" indicates the shortest path length between node 1 and node 3, but we can see from the graph that this length should be "2".
I would appreciate any comments you may have!
The text was updated successfully, but these errors were encountered: