{"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/training-deep-neural-networks-with-adaptive","title":"Training Deep Neural Networks with Adaptive Momentum Inspired by the Quadratic Optimization","arxiv_id":"2110.09057","date":"2021-10-18","proceeding":null,"authors":["Tao Sun","Huaming Ling","Zuoqiang Shi","Dongsheng Li","Bao Wang"],"abstract":"Heavy ball momentum is crucial in accelerating (stochastic) gradient-based optimization algorithms for machine learning. Existing heavy ball momentum is usually weighted by a uniform hyperparameter, which relies on excessive tuning. Moreover, the calibrated fixed hyperparameter may not lead to optimal performance. In this paper, to eliminate the effort for tuning the momentum-related hyperparameter, we propose a new adaptive momentum inspired by the optimal choice of the heavy ball momentum for quadratic optimization. Our proposed adaptive heavy ball momentum can improve stochastic gradient descent (SGD) and Adam. SGD and Adam with the newly designed adaptive momentum are more robust to large learning rates, converge faster, and generalize better than the baselines. We verify the efficiency of SGD and Adam with the new adaptive momentum on extensive machine learning benchmarks, including image classification, language modeling, and machine translation. Finally, we provide convergence guarantees for SGD and Adam with the proposed adaptive momentum.","url_abs":"https://arxiv.org/abs/2110.09057v1","url_pdf":"https://arxiv.org/pdf/2110.09057v1.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":"training-deep-neural-networks-with-adaptive","repo_url":"https://github.com/kentaroy47/vision-transformers-cifar10","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"machine-learning","task_name":"BIG-bench Machine Learning"},{"task_slug":"image-classification","task_name":"Image Classification"},{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"machine-translation","task_name":"Machine Translation"},{"task_slug":"translation","task_name":"Translation"},{"task_slug":"image-classification","task_name":"image-classification"}],"methods":[{"method_slug":"adam","method_name":"Adam"},{"method_slug":"sgd","method_name":"SGD"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2110.09057","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2110.09057"}},"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/kentaroy47/vision-transformers-cifar10","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":5,"ran":2,"ran_violates":3,"ran_honours":1,"ran_fixture":1,"unverified":5},"by_repo_kind":{"official":{"samples":17,"ran":12,"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":"a7690d61376264fc","entry":"ConvMixer","repo":"kentaroy47/vision-transformers-cifar10","repo_kind":"official","path":"models/convmixer.py","file_url":"https://github.com/kentaroy47/vision-transformers-cifar10/blob/HEAD/models/convmixer.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":"a7690d61376264fc"}},{"code_sha256_prefix":"7ad86819c80a33c6","entry":"FeedForward","repo":"kentaroy47/vision-transformers-cifar10","repo_kind":"official","path":"models/mlpmixer.py","file_url":"https://github.com/kentaroy47/vision-transformers-cifar10/blob/HEAD/models/mlpmixer.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":"7ad86819c80a33c6"}},{"code_sha256_prefix":"0f23e7e681845fe0","entry":"ResNet18","repo":"kentaroy47/vision-transformers-cifar10","repo_kind":"official","path":"models/resnet.py","file_url":"https://github.com/kentaroy47/vision-transformers-cifar10/blob/HEAD/models/resnet.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":"0f23e7e681845fe0"}},{"code_sha256_prefix":"21ba14c82993c2fe","entry":"ResNet50","repo":"kentaroy47/vision-transformers-cifar10","repo_kind":"official","path":"models/resnet.py","file_url":"https://github.com/kentaroy47/vision-transformers-cifar10/blob/HEAD/models/resnet.py","link_basis":"harvester_set","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":"21ba14c82993c2fe"}},{"code_sha256_prefix":"3fb34464dacbb0d3","entry":"conv_1x1_bn","repo":"kentaroy47/vision-transformers-cifar10","repo_kind":"official","path":"models/mobilevit.py","file_url":"https://github.com/kentaroy47/vision-transformers-cifar10/blob/HEAD/models/mobilevit.py","link_basis":"harvester_set","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":"3fb34464dacbb0d3"}},{"code_sha256_prefix":"e01bc963fa545868","entry":"conv_nxn_bn","repo":"kentaroy47/vision-transformers-cifar10","repo_kind":"official","path":"models/mobilevit.py","file_url":"https://github.com/kentaroy47/vision-transformers-cifar10/blob/HEAD/models/mobilevit.py","link_basis":"harvester_set","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":"e01bc963fa545868"}},{"code_sha256_prefix":"c0a5cd5e8d1e1870","entry":"create_mask","repo":"kentaroy47/vision-transformers-cifar10","repo_kind":"official","path":"models/swin.py","file_url":"https://github.com/kentaroy47/vision-transformers-cifar10/blob/HEAD/models/swin.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c0a5cd5e8d1e1870"}},{"code_sha256_prefix":"5c177b03eb4157b4","entry":"dropout_layers","repo":"kentaroy47/vision-transformers-cifar10","repo_kind":"official","path":"models/cait.py","file_url":"https://github.com/kentaroy47/vision-transformers-cifar10/blob/HEAD/models/cait.py","link_basis":"harvester_set","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":"5c177b03eb4157b4"}},{"code_sha256_prefix":"aa5486a3650902d8","entry":"exists","repo":"kentaroy47/vision-transformers-cifar10","repo_kind":"official","path":"models/cait.py","file_url":"https://github.com/kentaroy47/vision-transformers-cifar10/blob/HEAD/models/cait.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":"aa5486a3650902d8"}},{"code_sha256_prefix":"ea931f8eaca3c48c","entry":"get_relative_distances","repo":"kentaroy47/vision-transformers-cifar10","repo_kind":"official","path":"models/swin.py","file_url":"https://github.com/kentaroy47/vision-transformers-cifar10/blob/HEAD/models/swin.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ea931f8eaca3c48c"}},{"code_sha256_prefix":"6ba8cee9f5daea41","entry":"pair","repo":"kentaroy47/vision-transformers-cifar10","repo_kind":"official","path":"models/dyt.py","file_url":"https://github.com/kentaroy47/vision-transformers-cifar10/blob/HEAD/models/dyt.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6ba8cee9f5daea41"}},{"code_sha256_prefix":"17f6d223949a7e58","entry":"posemb_sincos_2d","repo":"kentaroy47/vision-transformers-cifar10","repo_kind":"official","path":"models/simplevit.py","file_url":"https://github.com/kentaroy47/vision-transformers-cifar10/blob/HEAD/models/simplevit.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"17f6d223949a7e58"}},{"code_sha256_prefix":"ac3dd06d1a08c549","entry":"ResNet34","repo":"kentaroy47/vision-transformers-cifar10","repo_kind":"official","path":"models/resnet.py","file_url":"https://github.com/kentaroy47/vision-transformers-cifar10/blob/HEAD/models/resnet.py","link_basis":"harvester_set","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":"ac3dd06d1a08c549"}},{"code_sha256_prefix":"4e79865ad6540be5","entry":"convert_ln_to_dyt","repo":"kentaroy47/vision-transformers-cifar10","repo_kind":"official","path":"models/dyt.py","file_url":"https://github.com/kentaroy47/vision-transformers-cifar10/blob/HEAD/models/dyt.py","link_basis":"harvester_set","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":"4e79865ad6540be5"}},{"code_sha256_prefix":"157f64840d3dfd7c","entry":"load_model","repo":"kentaroy47/vision-transformers-cifar10","repo_kind":"official","path":"export_models.py","file_url":"https://github.com/kentaroy47/vision-transformers-cifar10/blob/HEAD/export_models.py","link_basis":"harvester_set","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":"157f64840d3dfd7c"}},{"code_sha256_prefix":"2e42a5b92c3a9f95","entry":"mobilevit_xxs","repo":"kentaroy47/vision-transformers-cifar10","repo_kind":"official","path":"models/mobilevit.py","file_url":"https://github.com/kentaroy47/vision-transformers-cifar10/blob/HEAD/models/mobilevit.py","link_basis":"harvester_set","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":"2e42a5b92c3a9f95"}},{"code_sha256_prefix":"516538f47edf5014","entry":"swin_t","repo":"kentaroy47/vision-transformers-cifar10","repo_kind":"official","path":"models/swin.py","file_url":"https://github.com/kentaroy47/vision-transformers-cifar10/blob/HEAD/models/swin.py","link_basis":"harvester_set","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":"516538f47edf5014"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}