{"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/distance-based-tree-sliced-wasserstein","title":"Distance-Based Tree-Sliced Wasserstein Distance","arxiv_id":"2503.11050","date":"2025-03-14","proceeding":null,"authors":["Hoang V. Tran","Khoi N. M. Nguyen","Trang Pham","Thanh T. Chu","Tam Le","Tan M. Nguyen"],"abstract":"To overcome computational challenges of Optimal Transport (OT), several variants of Sliced Wasserstein (SW) has been developed in the literature. These approaches exploit the closed-form expression of the univariate OT by projecting measures onto (one-dimensional) lines. However, projecting measures onto low-dimensional spaces can lead to a loss of topological information. Tree-Sliced Wasserstein distance on Systems of Lines (TSW-SL) has emerged as a promising alternative that replaces these lines with a more advanced structure called tree systems. The tree structures enhance the ability to capture topological information of the metric while preserving computational efficiency. However, at the core of TSW-SL, the splitting maps, which serve as the mechanism for pushing forward measures onto tree systems, focus solely on the position of the measure supports while disregarding the projecting domains. Moreover, the specific splitting map used in TSW-SL leads to a metric that is not invariant under Euclidean transformations, a typically expected property for OT on Euclidean space. In this work, we propose a novel class of splitting maps that generalizes the existing one studied in TSW-SL enabling the use of all positional information from input measures, resulting in a novel Distance-based Tree-Sliced Wasserstein (Db-TSW) distance. In addition, we introduce a simple tree sampling process better suited for Db-TSW, leading to an efficient GPU-friendly implementation for tree systems, similar to the original SW. We also provide a comprehensive theoretical analysis of proposed class of splitting maps to verify the injectivity of the corresponding Radon Transform, and demonstrate that Db-TSW is an Euclidean invariant metric. We empirically show that Db-TSW significantly improves accuracy compared to recent SW variants while maintaining low computational cost via a wide range of experiments.","url_abs":"https://arxiv.org/abs/2503.11050v1","url_pdf":"https://arxiv.org/pdf/2503.11050v1.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":"distance-based-tree-sliced-wasserstein","repo_url":"https://github.com/Fsoft-AIC/DbTSW","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"computational-efficiency","task_name":"Computational Efficiency"},{"task_slug":null,"task_name":"GPU"}],"methods":[{"method_slug":"focus","method_name":"Focus"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2503.11050","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2503.11050"}},"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/Fsoft-AIC/DbTSW","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran_draft_wrong":1,"ran_violates":2,"unverified":16},"by_repo_kind":{"official":{"samples":19,"ran":3,"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":"a32f853e4b62793c","entry":"preds2score","repo":"Fsoft-AIC/DbTSW","repo_kind":"official","path":"experiments/denoising-diffusion-gan/pytorch_fid/inception_score.py","file_url":"https://github.com/Fsoft-AIC/DbTSW/blob/HEAD/experiments/denoising-diffusion-gan/pytorch_fid/inception_score.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a32f853e4b62793c"}},{"code_sha256_prefix":"f017532fc389cbfe","entry":"str2bool","repo":"Fsoft-AIC/DbTSW","repo_kind":"official","path":"experiments/gradient-flow/cfg.py","file_url":"https://github.com/Fsoft-AIC/DbTSW/blob/HEAD/experiments/gradient-flow/cfg.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f017532fc389cbfe"}},{"code_sha256_prefix":"65846ba5525a01b5","entry":"var_func_geometric","repo":"Fsoft-AIC/DbTSW","repo_kind":"official","path":"experiments/denoising-diffusion-gan/train_ddgan.py","file_url":"https://github.com/Fsoft-AIC/DbTSW/blob/HEAD/experiments/denoising-diffusion-gan/train_ddgan.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"65846ba5525a01b5"}},{"code_sha256_prefix":"10853de1303723dd","entry":"W2_1d","repo":"Fsoft-AIC/DbTSW","repo_kind":"official","path":"experiments/gradient-flow/core/SWGG.py","file_url":"https://github.com/Fsoft-AIC/DbTSW/blob/HEAD/experiments/gradient-flow/core/SWGG.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"10853de1303723dd"}},{"code_sha256_prefix":"805b00de71cd788c","entry":"W2_proj","repo":"Fsoft-AIC/DbTSW","repo_kind":"official","path":"experiments/gradient-flow/core/SWGG.py","file_url":"https://github.com/Fsoft-AIC/DbTSW/blob/HEAD/experiments/gradient-flow/core/SWGG.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"805b00de71cd788c"}},{"code_sha256_prefix":"bd88683e6bd4454d","entry":"calculate_activation_statistics","repo":"Fsoft-AIC/DbTSW","repo_kind":"official","path":"experiments/denoising-diffusion-gan/pytorch_fid/fid_score.py","file_url":"https://github.com/Fsoft-AIC/DbTSW/blob/HEAD/experiments/denoising-diffusion-gan/pytorch_fid/fid_score.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"bd88683e6bd4454d"}},{"code_sha256_prefix":"fcdc92d3d2e8edc1","entry":"calculate_frechet_distance","repo":"Fsoft-AIC/DbTSW","repo_kind":"official","path":"experiments/denoising-diffusion-gan/pytorch_fid/fid_score.py","file_url":"https://github.com/Fsoft-AIC/DbTSW/blob/HEAD/experiments/denoising-diffusion-gan/pytorch_fid/fid_score.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"fcdc92d3d2e8edc1"}},{"code_sha256_prefix":"df383ed042cd440b","entry":"compute_Wasserstein","repo":"Fsoft-AIC/DbTSW","repo_kind":"official","path":"experiments/gradient-flow/core/gradient_flow.py","file_url":"https://github.com/Fsoft-AIC/DbTSW/blob/HEAD/experiments/gradient-flow/core/gradient_flow.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"df383ed042cd440b"}},{"code_sha256_prefix":"5803c476aaa8df6b","entry":"compute_bary_line","repo":"Fsoft-AIC/DbTSW","repo_kind":"official","path":"experiments/gradient-flow/core/SWGG.py","file_url":"https://github.com/Fsoft-AIC/DbTSW/blob/HEAD/experiments/gradient-flow/core/SWGG.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5803c476aaa8df6b"}},{"code_sha256_prefix":"56c0afd58960e460","entry":"compute_true_Wasserstein","repo":"Fsoft-AIC/DbTSW","repo_kind":"official","path":"experiments/gradient-flow/core/gradient_flow.py","file_url":"https://github.com/Fsoft-AIC/DbTSW/blob/HEAD/experiments/gradient-flow/core/gradient_flow.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"56c0afd58960e460"}},{"code_sha256_prefix":"dbaf06f6ab72167f","entry":"extract","repo":"Fsoft-AIC/DbTSW","repo_kind":"official","path":"experiments/denoising-diffusion-gan/train_ddgan.py","file_url":"https://github.com/Fsoft-AIC/DbTSW/blob/HEAD/experiments/denoising-diffusion-gan/train_ddgan.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"dbaf06f6ab72167f"}},{"code_sha256_prefix":"44a9a491a88a84ec","entry":"generate_trees_frames","repo":"Fsoft-AIC/DbTSW","repo_kind":"official","path":"db_tsw/utils.py","file_url":"https://github.com/Fsoft-AIC/DbTSW/blob/HEAD/db_tsw/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"44a9a491a88a84ec"}},{"code_sha256_prefix":"26edbd4467e04bec","entry":"get_activations","repo":"Fsoft-AIC/DbTSW","repo_kind":"official","path":"experiments/denoising-diffusion-gan/pytorch_fid/fid_score.py","file_url":"https://github.com/Fsoft-AIC/DbTSW/blob/HEAD/experiments/denoising-diffusion-gan/pytorch_fid/fid_score.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"26edbd4467e04bec"}},{"code_sha256_prefix":"0c49eeb3efa10d5b","entry":"make_blobs_random","repo":"Fsoft-AIC/DbTSW","repo_kind":"official","path":"experiments/gradient-flow/core/generate_data.py","file_url":"https://github.com/Fsoft-AIC/DbTSW/blob/HEAD/experiments/gradient-flow/core/generate_data.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0c49eeb3efa10d5b"}},{"code_sha256_prefix":"281c672a91d898db","entry":"make_blobs_reg","repo":"Fsoft-AIC/DbTSW","repo_kind":"official","path":"experiments/gradient-flow/core/generate_data.py","file_url":"https://github.com/Fsoft-AIC/DbTSW/blob/HEAD/experiments/gradient-flow/core/generate_data.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"281c672a91d898db"}},{"code_sha256_prefix":"e6859576298167fd","entry":"make_spiral","repo":"Fsoft-AIC/DbTSW","repo_kind":"official","path":"experiments/gradient-flow/core/generate_data.py","file_url":"https://github.com/Fsoft-AIC/DbTSW/blob/HEAD/experiments/gradient-flow/core/generate_data.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e6859576298167fd"}},{"code_sha256_prefix":"a23adc90085cc7b7","entry":"svd_orthogonalize","repo":"Fsoft-AIC/DbTSW","repo_kind":"official","path":"db_tsw/utils.py","file_url":"https://github.com/Fsoft-AIC/DbTSW/blob/HEAD/db_tsw/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a23adc90085cc7b7"}},{"code_sha256_prefix":"56963d39c9de6af6","entry":"temperature","repo":"Fsoft-AIC/DbTSW","repo_kind":"official","path":"experiments/gradient-flow/core/Simulated_Annealing.py","file_url":"https://github.com/Fsoft-AIC/DbTSW/blob/HEAD/experiments/gradient-flow/core/Simulated_Annealing.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"56963d39c9de6af6"}},{"code_sha256_prefix":"37f4a211c7f3b70a","entry":"var_func_vp","repo":"Fsoft-AIC/DbTSW","repo_kind":"official","path":"experiments/denoising-diffusion-gan/train_ddgan.py","file_url":"https://github.com/Fsoft-AIC/DbTSW/blob/HEAD/experiments/denoising-diffusion-gan/train_ddgan.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"37f4a211c7f3b70a"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}