{"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/control-variate-sliced-wasserstein-estimators","title":"Sliced Wasserstein Estimation with Control Variates","arxiv_id":"2305.00402","date":"2023-04-30","proceeding":null,"authors":["Khai Nguyen","Nhat Ho"],"abstract":"The sliced Wasserstein (SW) distances between two probability measures are defined as the expectation of the Wasserstein distance between two one-dimensional projections of the two measures. The randomness comes from a projecting direction that is used to project the two input measures to one dimension. Due to the intractability of the expectation, Monte Carlo integration is performed to estimate the value of the SW distance. Despite having various variants, there has been no prior work that improves the Monte Carlo estimation scheme for the SW distance in terms of controlling its variance. To bridge the literature on variance reduction and the literature on the SW distance, we propose computationally efficient control variates to reduce the variance of the empirical estimation of the SW distance. The key idea is to first find Gaussian approximations of projected one-dimensional measures, then we utilize the closed-form of the Wasserstein-2 distance between two Gaussian distributions to design the control variates. In particular, we propose using a lower bound and an upper bound of the Wasserstein-2 distance between two fitted Gaussians as two computationally efficient control variates. We empirically show that the proposed control variate estimators can help to reduce the variance considerably when comparing measures over images and point-clouds. Finally, we demonstrate the favorable performance of the proposed control variate estimators in gradient flows to interpolate between two point-clouds and in deep generative modeling on standard image datasets, such as CIFAR10 and CelebA.","url_abs":"https://arxiv.org/abs/2305.00402v2","url_pdf":"https://arxiv.org/pdf/2305.00402v2.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":"control-variate-sliced-wasserstein-estimators","repo_url":"https://github.com/khainb/cv-sw","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2305.00402","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2305.00402"}},"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/khainb/cv-sw","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":1,"ran_violates":1,"unverified":4},"by_repo_kind":{"official":{"samples":6,"ran":2,"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":"0615b65a5b3297b7","entry":"copy_params","repo":"khainb/cv-sw","repo_kind":"official","path":"Generative_model/functions.py","file_url":"https://github.com/khainb/cv-sw/blob/HEAD/Generative_model/functions.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0615b65a5b3297b7"}},{"code_sha256_prefix":"f017532fc389cbfe","entry":"str2bool","repo":"khainb/cv-sw","repo_kind":"official","path":"Generative_model/cfg.py","file_url":"https://github.com/khainb/cv-sw/blob/HEAD/Generative_model/cfg.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f017532fc389cbfe"}},{"code_sha256_prefix":"0090c00eaf2e8478","entry":"calculate_activation_statistics","repo":"khainb/cv-sw","repo_kind":"official","path":"Generative_model/utils/fid_score.py","file_url":"https://github.com/khainb/cv-sw/blob/HEAD/Generative_model/utils/fid_score.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0090c00eaf2e8478"}},{"code_sha256_prefix":"f82d43c86ff154eb","entry":"calculate_frechet_distance","repo":"khainb/cv-sw","repo_kind":"official","path":"Generative_model/utils/fid_score.py","file_url":"https://github.com/khainb/cv-sw/blob/HEAD/Generative_model/utils/fid_score.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f82d43c86ff154eb"}},{"code_sha256_prefix":"e1bb4b52f28ec8e0","entry":"get_activations","repo":"khainb/cv-sw","repo_kind":"official","path":"Generative_model/utils/fid_score.py","file_url":"https://github.com/khainb/cv-sw/blob/HEAD/Generative_model/utils/fid_score.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e1bb4b52f28ec8e0"}},{"code_sha256_prefix":"96beebd62928ee28","entry":"rand_projections","repo":"khainb/cv-sw","repo_kind":"official","path":"Generative_model/functions.py","file_url":"https://github.com/khainb/cv-sw/blob/HEAD/Generative_model/functions.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"96beebd62928ee28"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}