{"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/rethinking-importance-weighting-for-deep","title":"Rethinking Importance Weighting for Deep Learning under Distribution Shift","arxiv_id":"2006.04662","date":"2020-06-08","proceeding":"NeurIPS 2020 12","authors":["Tongtong Fang","Nan Lu","Gang Niu","Masashi Sugiyama"],"abstract":"Under distribution shift (DS) where the training data distribution differs from the test one, a powerful technique is importance weighting (IW) which handles DS in two separate steps: weight estimation (WE) estimates the test-over-training density ratio and weighted classification (WC) trains the classifier from weighted training data. However, IW cannot work well on complex data, since WE is incompatible with deep learning. In this paper, we rethink IW and theoretically show it suffers from a circular dependency: we need not only WE for WC, but also WC for WE where a trained deep classifier is used as the feature extractor (FE). To cut off the dependency, we try to pretrain FE from unweighted training data, which leads to biased FE. To overcome the bias, we propose an end-to-end solution dynamic IW that iterates between WE and WC and combines them in a seamless manner, and hence our WE can also enjoy deep networks and stochastic optimizers indirectly. Experiments with two representative types of DS on three popular datasets show that our dynamic IW compares favorably with state-of-the-art methods.","url_abs":"https://arxiv.org/abs/2006.04662v2","url_pdf":"https://arxiv.org/pdf/2006.04662v2.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":"rethinking-importance-weighting-for-deep","repo_url":"https://github.com/TongtongFANG/DIW","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"deep-learning","task_name":"Deep Learning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2006.04662","atlas_url":"https://app.syntology.ai/?focus=2006.04662","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2006.04662"}},"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/TongtongFANG/DIW","reach":null}],"summary":{"ran_draft_wrong":1,"ran_honours":3,"unverified":8},"by_repo_kind":{"official":{"samples":11,"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":1,"samples":[{"code_sha256_prefix":"dc221e9b2bf38877","entry":"get_int","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"dc221e9b2bf38877"}},{"code_sha256_prefix":"96b46f91d8c488e9","entry":"read_image_file","repo":"TongtongFANG/DIW","repo_kind":"official","path":"diw.py","file_url":"https://github.com/TongtongFANG/DIW/blob/HEAD/diw.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"96b46f91d8c488e9"}},{"code_sha256_prefix":"e983c94b0048922f","entry":"read_label_file","repo":"TongtongFANG/DIW","repo_kind":"official","path":"diw.py","file_url":"https://github.com/TongtongFANG/DIW/blob/HEAD/diw.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e983c94b0048922f"}},{"code_sha256_prefix":"00780a5caa71ae85","entry":"to_cuda","repo":"TongtongFANG/DIW","repo_kind":"official","path":"diw.py","file_url":"https://github.com/TongtongFANG/DIW/blob/HEAD/diw.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"00780a5caa71ae85"}},{"code_sha256_prefix":"ac3f111fe972ebda","entry":"F_MNIST","repo":"TongtongFANG/DIW","repo_kind":"official","path":"diw.py","file_url":"https://github.com/TongtongFANG/DIW/blob/HEAD/diw.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":"ac3f111fe972ebda"}},{"code_sha256_prefix":"9cf1ac4fc94dbc63","entry":"F_MNIST_dataloader","repo":"TongtongFANG/DIW","repo_kind":"official","path":"diw.py","file_url":"https://github.com/TongtongFANG/DIW/blob/HEAD/diw.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":"9cf1ac4fc94dbc63"}},{"code_sha256_prefix":"5638359173adcc9e","entry":"build_model","repo":"TongtongFANG/DIW","repo_kind":"official","path":"diw.py","file_url":"https://github.com/TongtongFANG/DIW/blob/HEAD/diw.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":"5638359173adcc9e"}},{"code_sha256_prefix":"08246f66c17ce87a","entry":"main","repo":"TongtongFANG/DIW","repo_kind":"official","path":"diw.py","file_url":"https://github.com/TongtongFANG/DIW/blob/HEAD/diw.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":"08246f66c17ce87a"}},{"code_sha256_prefix":"5f14559820810bee","entry":"multiclass_noisify","repo":"TongtongFANG/DIW","repo_kind":"official","path":"diw.py","file_url":"https://github.com/TongtongFANG/DIW/blob/HEAD/diw.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":"5f14559820810bee"}},{"code_sha256_prefix":"ce5a86971e99ddaf","entry":"noisify","repo":"TongtongFANG/DIW","repo_kind":"official","path":"diw.py","file_url":"https://github.com/TongtongFANG/DIW/blob/HEAD/diw.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":"ce5a86971e99ddaf"}},{"code_sha256_prefix":"b6263dc51a463ff5","entry":"noisify_multiclass_symmetric","repo":"TongtongFANG/DIW","repo_kind":"official","path":"diw.py","file_url":"https://github.com/TongtongFANG/DIW/blob/HEAD/diw.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":"b6263dc51a463ff5"}},{"code_sha256_prefix":"06e058537f7d4d91","entry":"noisify_pairflip","repo":"TongtongFANG/DIW","repo_kind":"official","path":"diw.py","file_url":"https://github.com/TongtongFANG/DIW/blob/HEAD/diw.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":"06e058537f7d4d91"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}