{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/fast-and-robust-comparison-of-probability","title":"Fast and Robust Comparison of Probability Measures in Heterogeneous Spaces","arxiv_id":"2002.01615","date":"2020-02-05","proceeding":null,"authors":["Ryoma Sato","Marco Cuturi","Makoto Yamada","Hisashi Kashima"],"abstract":"Comparing two probability measures supported on heterogeneous spaces is an increasingly important problem in machine learning. Such problems arise when comparing for instance two populations of biological cells, each described with its own set of features, or when looking at families of word embeddings trained across different corpora/languages. For such settings, the Gromov Wasserstein (GW) distance is often presented as the gold standard. GW is intuitive, as it quantifies whether one measure can be isomorphically mapped to the other. However, its exact computation is intractable, and most algorithms that claim to approximate it remain expensive. Building on \\cite{memoli-2011}, who proposed to represent each point in each distribution as the 1D distribution of its distances to all other points, we introduce in this paper the Anchor Energy (AE) and Anchor Wasserstein (AW) distances, which are respectively the energy and Wasserstein distances instantiated on such representations. Our main contribution is to propose a sweep line algorithm to compute AE \\emph{exactly} in log-quadratic time, where a naive implementation would be cubic. This is quasi-linear w.r.t. the description of the problem itself. Our second contribution is the proposal of robust variants of AE and AW that uses rank statistics rather than the original distances. We show that AE and AW perform well in various experimental settings at a fraction of the computational cost of popular GW approximations. Code is available at \\url{https://github.com/joisino/anchor-energy}.","url_abs":"https://arxiv.org/abs/2002.01615v3","url_pdf":"https://arxiv.org/pdf/2002.01615v3.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"fast-and-robust-comparison-of-probability","repo_url":"https://github.com/joisino/anchor-energy","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"graph-matching","task_name":"Graph Matching"},{"task_slug":"word-embeddings","task_name":"Word Embeddings"}],"methods":[{"method_slug":"ae","method_name":"AE"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2002.01615","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2002.01615"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/joisino/anchor-energy","reach":null}],"summary":{"ran_draft_wrong":2,"ran_honours":1,"ran_fixture":1},"by_repo_kind":{"official":{"samples":4,"ran":4,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"825c1deb8e5d92bb","entry":"AnchorFeature","repo":"joisino/anchor-energy","repo_kind":"official","path":"pytorch/distance_comparison.py","file_url":"https://github.com/joisino/anchor-energy/blob/HEAD/pytorch/distance_comparison.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"825c1deb8e5d92bb"}},{"code_sha256_prefix":"494b3d3f4cffe75d","entry":"AnchorFeatureDistance","repo":"joisino/anchor-energy","repo_kind":"official","path":"pytorch/distance_comparison.py","file_url":"https://github.com/joisino/anchor-energy/blob/HEAD/pytorch/distance_comparison.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"494b3d3f4cffe75d"}},{"code_sha256_prefix":"40a010b817251818","entry":"load","repo":"joisino/anchor-energy","repo_kind":"official","path":"sample.py","file_url":"https://github.com/joisino/anchor-energy/blob/HEAD/sample.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"40a010b817251818"}},{"code_sha256_prefix":"99c8f49778a62739","entry":"log_sinkhorn","repo":"joisino/anchor-energy","repo_kind":"official","path":"pytorch/distance_comparison.py","file_url":"https://github.com/joisino/anchor-energy/blob/HEAD/pytorch/distance_comparison.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"99c8f49778a62739"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}