{"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/domain-adaptation-with-conditional","title":"Domain Adaptation with Conditional Distribution Matching and Generalized Label Shift","arxiv_id":"2003.04475","date":"2020-03-10","proceeding":"NeurIPS 2020 12","authors":["Remi Tachet","Han Zhao","Yu-Xiang Wang","Geoff Gordon"],"abstract":"Adversarial learning has demonstrated good performance in the unsupervised domain adaptation setting, by learning domain-invariant representations. However, recent work has shown limitations of this approach when label distributions differ between the source and target domains. In this paper, we propose a new assumption, generalized label shift ($GLS$), to improve robustness against mismatched label distributions. $GLS$ states that, conditioned on the label, there exists a representation of the input that is invariant between the source and target domains. Under $GLS$, we provide theoretical guarantees on the transfer performance of any classifier. We also devise necessary and sufficient conditions for $GLS$ to hold, by using an estimation of the relative class weights between domains and an appropriate reweighting of samples. Our weight estimation method could be straightforwardly and generically applied in existing domain adaptation (DA) algorithms that learn domain-invariant representations, with small computational overhead. In particular, we modify three DA algorithms, JAN, DANN and CDAN, and evaluate their performance on standard and artificial DA tasks. Our algorithms outperform the base versions, with vast improvements for large label distribution mismatches. Our code is available at https://tinyurl.com/y585xt6j.","url_abs":"https://arxiv.org/abs/2003.04475v3","url_pdf":"https://arxiv.org/pdf/2003.04475v3.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":"domain-adaptation-with-conditional","repo_url":"https://github.com/timgaripov/asa","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"domain-adaptation","task_name":"Domain Adaptation"},{"task_slug":"multi-class-classification","task_name":"Multi-class Classification"},{"task_slug":"unsupervised-domain-adaptation","task_name":"Unsupervised Domain Adaptation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2003.04475","atlas_url":"https://app.syntology.ai/?focus=2003.04475","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2003.04475"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/timgaripov/asa","reach":null}],"summary":{"ran":1,"ran_draft_wrong":3,"unverified":2},"by_repo_kind":{"listed":{"samples":6,"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":"abd2c75272446f0b","entry":"Algorithm","repo":"timgaripov/asa","repo_kind":"listed","path":"support_alignment/core/algorithms.py","file_url":"https://github.com/timgaripov/asa/blob/HEAD/support_alignment/core/algorithms.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"abd2c75272446f0b"}},{"code_sha256_prefix":"84a728cc32e47538","entry":"create_linear_decay_lr_schedule","repo":"timgaripov/asa","repo_kind":"listed","path":"support_alignment/core/algorithms.py","file_url":"https://github.com/timgaripov/asa/blob/HEAD/support_alignment/core/algorithms.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"84a728cc32e47538"}},{"code_sha256_prefix":"01e1e5c155e3406e","entry":"get_optimizer","repo":"timgaripov/asa","repo_kind":"listed","path":"support_alignment/core/algorithms.py","file_url":"https://github.com/timgaripov/asa/blob/HEAD/support_alignment/core/algorithms.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"01e1e5c155e3406e"}},{"code_sha256_prefix":"221a2b83cae89e92","entry":"process_param_groups","repo":"timgaripov/asa","repo_kind":"listed","path":"support_alignment/core/algorithms.py","file_url":"https://github.com/timgaripov/asa/blob/HEAD/support_alignment/core/algorithms.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"221a2b83cae89e92"}},{"code_sha256_prefix":"aa01754b6b04b3a2","entry":"DANetwork","repo":"timgaripov/asa","repo_kind":"listed","path":"support_alignment/core/algorithms.py","file_url":"https://github.com/timgaripov/asa/blob/HEAD/support_alignment/core/algorithms.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":"aa01754b6b04b3a2"}},{"code_sha256_prefix":"05a633b33c7c1fc6","entry":"IWBase","repo":"timgaripov/asa","repo_kind":"listed","path":"support_alignment/core/algorithms.py","file_url":"https://github.com/timgaripov/asa/blob/HEAD/support_alignment/core/algorithms.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":"05a633b33c7c1fc6"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}