{"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/anode-unconditionally-accurate-memory","title":"ANODE: Unconditionally Accurate Memory-Efficient Gradients for Neural ODEs","arxiv_id":"1902.10298","date":"2019-02-27","proceeding":null,"authors":["Amir Gholami","Kurt Keutzer","George Biros"],"abstract":"Residual neural networks can be viewed as the forward Euler discretization of an Ordinary Differential Equation (ODE) with a unit time step. This has recently motivated researchers to explore other discretization approaches and train ODE based networks. However, an important challenge of neural ODEs is their prohibitive memory cost during gradient backpropogation. Recently a method proposed in [8], claimed that this memory overhead can be reduced from O(LN_t), where N_t is the number of time steps, down to O(L) by solving forward ODE backwards in time, where L is the depth of the network. However, we will show that this approach may lead to several problems: (i) it may be numerically unstable for ReLU/non-ReLU activations and general convolution operators, and (ii) the proposed optimize-then-discretize approach may lead to divergent training due to inconsistent gradients for small time step sizes. We discuss the underlying problems, and to address them we propose ANODE, an Adjoint based Neural ODE framework which avoids the numerical instability related problems noted above, and provides unconditionally accurate gradients. ANODE has a memory footprint of O(L) + O(N_t), with the same computational cost as reversing ODE solve. We furthermore, discuss a memory efficient algorithm which can further reduce this footprint with a trade-off of additional computational cost. We show results on Cifar-10/100 datasets using ResNet and SqueezeNext neural networks.","url_abs":"https://arxiv.org/abs/1902.10298v3","url_pdf":"https://arxiv.org/pdf/1902.10298v3.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":"anode-unconditionally-accurate-memory","repo_url":"https://github.com/5yearsKim/HamiltonianFlow","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"anode-unconditionally-accurate-memory","repo_url":"https://github.com/alexandrejash/Chivvo","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"anode-unconditionally-accurate-memory","repo_url":"https://github.com/amirgholami/anode","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"anode-unconditionally-accurate-memory","repo_url":"https://github.com/juliagusak/neural-ode-norm","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"anode-unconditionally-accurate-memory","repo_url":"https://github.com/rg321/anode_mtvso","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"GPL-3.0"}}],"tasks":[{"task_slug":"clustering-multivariate-time-series","task_name":"Clustering Multivariate Time Series"},{"task_slug":"multivariate-time-series-imputation","task_name":"Multivariate Time Series Imputation"}],"methods":[{"method_slug":"1x1-convolution","method_name":"1x1 Convolution"},{"method_slug":"average-pooling","method_name":"Average Pooling"},{"method_slug":"batch-normalization","method_name":"Batch Normalization"},{"method_slug":"bottleneck-residual-block","method_name":"Bottleneck Residual Block"},{"method_slug":"convolution","method_name":"Convolution"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"global-average-pooling","method_name":"Global Average Pooling"},{"method_slug":"kaiming-initialization","method_name":"Kaiming Initialization"},{"method_slug":"max-pooling","method_name":"Max Pooling"},{"method_slug":"relu","method_name":"ReLU"},{"method_slug":"residual-block","method_name":"Residual Block"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"spatially-separable-convolution","method_name":"Spatially Separable Convolution"},{"method_slug":"squeezenext","method_name":"SqueezeNeXt"},{"method_slug":"squeezenext-block","method_name":"SqueezeNeXt Block"},{"method_slug":"xavier-initialization","method_name":"Xavier Initialization"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1902.10298","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1902.10298"}},"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/5yearsKim/HamiltonianFlow","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/amirgholami/anode","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/rg321/anode_mtvso","reach":{"status":"ok","spdx":"GPL-3.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/juliagusak/neural-ode-norm","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/alexandrejash/Chivvo","reach":null}],"summary":{"ran_honours":2,"unverified":5},"by_repo_kind":{"listed":{"samples":7,"ran":2,"repositories":2}},"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":"ddfbcc8cc75b02bd","entry":"flatten_params","repo":"amirgholami/anode","repo_kind":"listed","path":"anode/adjoint.py","file_url":"https://github.com/amirgholami/anode/blob/HEAD/anode/adjoint.py","link_basis":"plan_row","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":"ddfbcc8cc75b02bd"}},{"code_sha256_prefix":"ed0688b1a9390dd0","entry":"flatten_params_grad","repo":"amirgholami/anode","repo_kind":"listed","path":"anode/adjoint.py","file_url":"https://github.com/amirgholami/anode/blob/HEAD/anode/adjoint.py","link_basis":"plan_row","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":"ed0688b1a9390dd0"}},{"code_sha256_prefix":"1b6ffb716fc20c05","entry":"ResNet18","repo":"amirgholami/anode","repo_kind":"listed","path":"models/resnet.py","file_url":"https://github.com/amirgholami/anode/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":"1b6ffb716fc20c05"}},{"code_sha256_prefix":"4531de796056a938","entry":"SqNxt_23_1x","repo":"amirgholami/anode","repo_kind":"listed","path":"models/sqnxt.py","file_url":"https://github.com/amirgholami/anode/blob/HEAD/models/sqnxt.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":"4531de796056a938"}},{"code_sha256_prefix":"2003406c1040031b","entry":"lr_schedule","repo":"amirgholami/anode","repo_kind":"listed","path":"models/resnet.py","file_url":"https://github.com/amirgholami/anode/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":"2003406c1040031b"}},{"code_sha256_prefix":"0cdb14ad4e254911","entry":"odesolver","repo":"amirgholami/anode","repo_kind":"listed","path":"anode/odesolver.py","file_url":"https://github.com/amirgholami/anode/blob/HEAD/anode/odesolver.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":"0cdb14ad4e254911"}},{"code_sha256_prefix":"e97bad62391de89f","entry":"odesolver_adjoint","repo":"alexandrejash/Chivvo","repo_kind":"listed","path":"anode/adjoint.py","file_url":"https://github.com/alexandrejash/Chivvo/blob/HEAD/anode/adjoint.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"e97bad62391de89f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}