{"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/uniform-sampling-over-episode-difficulty","title":"Uniform Sampling over Episode Difficulty","arxiv_id":"2108.01662","date":"2021-08-03","proceeding":"NeurIPS 2021 12","authors":["Sébastien M. R. Arnold","Guneet S. Dhillon","Avinash Ravichandran","Stefano Soatto"],"abstract":"Episodic training is a core ingredient of few-shot learning to train models on tasks with limited labelled data. Despite its success, episodic training remains largely understudied, prompting us to ask the question: what is the best way to sample episodes? In this paper, we first propose a method to approximate episode sampling distributions based on their difficulty. Building on this method, we perform an extensive analysis and find that sampling uniformly over episode difficulty outperforms other sampling schemes, including curriculum and easy-/hard-mining. As the proposed sampling method is algorithm agnostic, we can leverage these insights to improve few-shot learning accuracies across many episodic training algorithms. We demonstrate the efficacy of our method across popular few-shot learning datasets, algorithms, network architectures, and protocols.","url_abs":"https://arxiv.org/abs/2108.01662v2","url_pdf":"https://arxiv.org/pdf/2108.01662v2.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":"uniform-sampling-over-episode-difficulty","repo_url":"https://github.com/amazon-science/uniform-episodic-sampling","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"uniform-sampling-over-episode-difficulty","repo_url":"https://github.com/amazon-research/uniform-episodic-sampling","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"few-shot-learning","task_name":"Few-Shot Learning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2108.01662","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2108.01662"}},"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/amazon-research/uniform-episodic-sampling","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/amazon-science/uniform-episodic-sampling","reach":null}],"summary":{"unverified":9},"by_repo_kind":{"official":{"samples":2,"ran":0,"repositories":1},"listed":{"samples":7,"ran":0,"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":"c5fcaf8ec6a44ec0","entry":"Importance","repo":"amazon-science/uniform-episodic-sampling","repo_kind":"official","path":"samplers.py","file_url":"https://github.com/amazon-science/uniform-episodic-sampling/blob/HEAD/samplers.py","link_basis":"first_harvest_node","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":"c5fcaf8ec6a44ec0"}},{"code_sha256_prefix":"b16e195bf7f6b335","entry":"UniformImportance","repo":"amazon-science/uniform-episodic-sampling","repo_kind":"official","path":"samplers.py","file_url":"https://github.com/amazon-science/uniform-episodic-sampling/blob/HEAD/samplers.py","link_basis":"first_harvest_node","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":"b16e195bf7f6b335"}},{"code_sha256_prefix":"5736865ddc66bcbd","entry":"acc_fn","repo":"amazon-research/uniform-episodic-sampling","repo_kind":"listed","path":"utils.py","file_url":"https://github.com/amazon-research/uniform-episodic-sampling/blob/HEAD/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":"5736865ddc66bcbd"}},{"code_sha256_prefix":"f18dc5f35e4d671a","entry":"cosine_proto_model","repo":"amazon-research/uniform-episodic-sampling","repo_kind":"listed","path":"algorithms.py","file_url":"https://github.com/amazon-research/uniform-episodic-sampling/blob/HEAD/algorithms.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":"f18dc5f35e4d671a"}},{"code_sha256_prefix":"201f6b2829446b5d","entry":"euclidean_distance","repo":"amazon-research/uniform-episodic-sampling","repo_kind":"listed","path":"utils.py","file_url":"https://github.com/amazon-research/uniform-episodic-sampling/blob/HEAD/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":"201f6b2829446b5d"}},{"code_sha256_prefix":"637145975dab2b28","entry":"get_cnn4","repo":"amazon-research/uniform-episodic-sampling","repo_kind":"listed","path":"models.py","file_url":"https://github.com/amazon-research/uniform-episodic-sampling/blob/HEAD/models.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":"637145975dab2b28"}},{"code_sha256_prefix":"72da35c07f9f52b9","entry":"get_resnet12","repo":"amazon-research/uniform-episodic-sampling","repo_kind":"listed","path":"models.py","file_url":"https://github.com/amazon-research/uniform-episodic-sampling/blob/HEAD/models.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":"72da35c07f9f52b9"}},{"code_sha256_prefix":"b801724537c6f3f8","entry":"proto_model","repo":"amazon-research/uniform-episodic-sampling","repo_kind":"listed","path":"algorithms.py","file_url":"https://github.com/amazon-research/uniform-episodic-sampling/blob/HEAD/algorithms.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":"b801724537c6f3f8"}},{"code_sha256_prefix":"71caea3a702c3323","entry":"task_to_support_query","repo":"amazon-research/uniform-episodic-sampling","repo_kind":"listed","path":"utils.py","file_url":"https://github.com/amazon-research/uniform-episodic-sampling/blob/HEAD/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":"71caea3a702c3323"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}