{"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/conditional-wasserstein-distances-with","title":"Conditional Wasserstein Distances with Applications in Bayesian OT Flow Matching","arxiv_id":"2403.18705","date":"2024-03-27","proceeding":null,"authors":["Jannis Chemseddine","Paul Hagemann","Gabriele Steidl","Christian Wald"],"abstract":"In inverse problems, many conditional generative models approximate the posterior measure by minimizing a distance between the joint measure and its learned approximation. While this approach also controls the distance between the posterior measures in the case of the Kullback--Leibler divergence, this is in general not hold true for the Wasserstein distance. In this paper, we introduce a conditional Wasserstein distance via a set of restricted couplings that equals the expected Wasserstein distance of the posteriors. Interestingly, the dual formulation of the conditional Wasserstein-1 flow resembles losses in the conditional Wasserstein GAN literature in a quite natural way. We derive theoretical properties of the conditional Wasserstein distance, characterize the corresponding geodesics and velocity fields as well as the flow ODEs. Subsequently, we propose to approximate the velocity fields by relaxing the conditional Wasserstein distance. Based on this, we propose an extension of OT Flow Matching for solving Bayesian inverse problems and demonstrate its numerical advantages on an inverse problem and class-conditional image generation.","url_abs":"https://arxiv.org/abs/2403.18705v2","url_pdf":"https://arxiv.org/pdf/2403.18705v2.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":"conditional-wasserstein-distances-with","repo_url":"https://github.com/jchemseddine/conditional_wasserstein_distances","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"conditional-image-generation","task_name":"Conditional Image Generation"},{"task_slug":"image-generation","task_name":"Image Generation"}],"methods":[{"method_slug":"set","method_name":"SET"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2403.18705","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2403.18705"}},"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/jchemseddine/conditional_wasserstein_distances","reach":{"status":"ok"}}],"summary":{"ran":6,"ran_draft_wrong":1,"unverified":9},"by_repo_kind":{"official":{"samples":16,"ran":7,"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":16,"samples":[{"code_sha256_prefix":"94bd78b15164446b","entry":"draw_mixture_dist","repo":"jchemseddine/conditional_wasserstein_distances","repo_kind":"official","path":"utils/Util_mixture.py","file_url":"https://github.com/jchemseddine/conditional_wasserstein_distances/blob/HEAD/utils/Util_mixture.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"94bd78b15164446b"}},{"code_sha256_prefix":"e41367ad14ff58fd","entry":"get_param_groups_and_shapes","repo":"jchemseddine/conditional_wasserstein_distances","repo_kind":"official","path":"utils/fp16_util.py","file_url":"https://github.com/jchemseddine/conditional_wasserstein_distances/blob/HEAD/utils/fp16_util.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e41367ad14ff58fd"}},{"code_sha256_prefix":"504e3a94c9a36991","entry":"get_single_gaussian_posterior","repo":"jchemseddine/conditional_wasserstein_distances","repo_kind":"official","path":"utils/Util_mixture.py","file_url":"https://github.com/jchemseddine/conditional_wasserstein_distances/blob/HEAD/utils/Util_mixture.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"504e3a94c9a36991"}},{"code_sha256_prefix":"e20dd5102da3b050","entry":"make_master_params","repo":"jchemseddine/conditional_wasserstein_distances","repo_kind":"official","path":"utils/fp16_util.py","file_url":"https://github.com/jchemseddine/conditional_wasserstein_distances/blob/HEAD/utils/fp16_util.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e20dd5102da3b050"}},{"code_sha256_prefix":"bcd8b4acab199405","entry":"make_output_format","repo":"jchemseddine/conditional_wasserstein_distances","repo_kind":"official","path":"utils/logger.py","file_url":"https://github.com/jchemseddine/conditional_wasserstein_distances/blob/HEAD/utils/logger.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"bcd8b4acab199405"}},{"code_sha256_prefix":"64fff1e30802b815","entry":"unflatten_master_params","repo":"jchemseddine/conditional_wasserstein_distances","repo_kind":"official","path":"utils/fp16_util.py","file_url":"https://github.com/jchemseddine/conditional_wasserstein_distances/blob/HEAD/utils/fp16_util.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"64fff1e30802b815"}},{"code_sha256_prefix":"129b804760b3115f","entry":"zero_module","repo":"jchemseddine/conditional_wasserstein_distances","repo_kind":"official","path":"utils/nn.py","file_url":"https://github.com/jchemseddine/conditional_wasserstein_distances/blob/HEAD/utils/nn.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":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"129b804760b3115f"}},{"code_sha256_prefix":"ecd0fc28815b65ae","entry":"avg_pool_nd","repo":"jchemseddine/conditional_wasserstein_distances","repo_kind":"official","path":"utils/nn.py","file_url":"https://github.com/jchemseddine/conditional_wasserstein_distances/blob/HEAD/utils/nn.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ecd0fc28815b65ae"}},{"code_sha256_prefix":"014ed7df4050e8a4","entry":"calculate_activation_statistics","repo":"jchemseddine/conditional_wasserstein_distances","repo_kind":"official","path":"utils/fid_score.py","file_url":"https://github.com/jchemseddine/conditional_wasserstein_distances/blob/HEAD/utils/fid_score.py","link_basis":"plan_row","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"014ed7df4050e8a4"}},{"code_sha256_prefix":"0def50a351111624","entry":"calculate_frechet_distance","repo":"jchemseddine/conditional_wasserstein_distances","repo_kind":"official","path":"utils/fid_score.py","file_url":"https://github.com/jchemseddine/conditional_wasserstein_distances/blob/HEAD/utils/fid_score.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0def50a351111624"}},{"code_sha256_prefix":"fe4eb545bbb728e0","entry":"conv_nd","repo":"jchemseddine/conditional_wasserstein_distances","repo_kind":"official","path":"utils/nn.py","file_url":"https://github.com/jchemseddine/conditional_wasserstein_distances/blob/HEAD/utils/nn.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"fe4eb545bbb728e0"}},{"code_sha256_prefix":"f10c698bdf0953d7","entry":"get_activations","repo":"jchemseddine/conditional_wasserstein_distances","repo_kind":"official","path":"utils/fid_score.py","file_url":"https://github.com/jchemseddine/conditional_wasserstein_distances/blob/HEAD/utils/fid_score.py","link_basis":"plan_row","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f10c698bdf0953d7"}},{"code_sha256_prefix":"ff0561a8f9d587e0","entry":"get_mixture_posterior","repo":"jchemseddine/conditional_wasserstein_distances","repo_kind":"official","path":"utils/Util_mixture.py","file_url":"https://github.com/jchemseddine/conditional_wasserstein_distances/blob/HEAD/utils/Util_mixture.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"ff0561a8f9d587e0"}},{"code_sha256_prefix":"e515a67f7f32e76d","entry":"mpi_weighted_mean","repo":"jchemseddine/conditional_wasserstein_distances","repo_kind":"official","path":"utils/logger.py","file_url":"https://github.com/jchemseddine/conditional_wasserstein_distances/blob/HEAD/utils/logger.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e515a67f7f32e76d"}},{"code_sha256_prefix":"0c6607473a4c4c55","entry":"profile","repo":"jchemseddine/conditional_wasserstein_distances","repo_kind":"official","path":"utils/logger.py","file_url":"https://github.com/jchemseddine/conditional_wasserstein_distances/blob/HEAD/utils/logger.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0c6607473a4c4c55"}},{"code_sha256_prefix":"383ae97dfafc251c","entry":"sample","repo":"jchemseddine/conditional_wasserstein_distances","repo_kind":"official","path":"utils/utils_FID.py","file_url":"https://github.com/jchemseddine/conditional_wasserstein_distances/blob/HEAD/utils/utils_FID.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"383ae97dfafc251c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}