Skip to content

Instantly share code, notes, and snippets.

@rahulbhadani
Created January 27, 2022 03:13
Show Gist options
  • Save rahulbhadani/26cc9b90f19f7b77d96a53581731ff0a to your computer and use it in GitHub Desktop.
Save rahulbhadani/26cc9b90f19f7b77d96a53581731ff0a to your computer and use it in GitHub Desktop.
The GW distance
C1 = sp.spatial.distance.cdist(xs, xs)
C2 = sp.spatial.distance.cdist(xt, xt)
C1 /= C1.max()
C2 /= C2.max()
pl.figure()
pl.subplot(121)
pl.imshow(C1)
pl.subplot(122)
pl.imshow(C2)
pl.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment