{"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/theseus-a-library-for-differentiable","title":"Theseus: A Library for Differentiable Nonlinear Optimization","arxiv_id":"2207.09442","date":"2022-07-19","proceeding":null,"authors":["Luis Pineda","Taosha Fan","Maurizio Monge","Shobha Venkataraman","Paloma Sodhi","Ricky T. Q. Chen","Joseph Ortiz","Daniel DeTone","Austin Wang","Stuart Anderson","Jing Dong","Brandon Amos","Mustafa Mukadam"],"abstract":"We present Theseus, an efficient application-agnostic open source library for differentiable nonlinear least squares (DNLS) optimization built on PyTorch, providing a common framework for end-to-end structured learning in robotics and vision. Existing DNLS implementations are application specific and do not always incorporate many ingredients important for efficiency. Theseus is application-agnostic, as we illustrate with several example applications that are built using the same underlying differentiable components, such as second-order optimizers, standard costs functions, and Lie groups. For efficiency, Theseus incorporates support for sparse solvers, automatic vectorization, batching, GPU acceleration, and gradient computation with implicit differentiation and direct loss minimization. We do extensive performance evaluation in a set of applications, demonstrating significant efficiency gains and better scalability when these features are incorporated. Project page: https://sites.google.com/view/theseus-ai","url_abs":"https://arxiv.org/abs/2207.09442v3","url_pdf":"https://arxiv.org/pdf/2207.09442v3.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":"theseus-a-library-for-differentiable","repo_url":"https://github.com/facebookresearch/theseus","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":null,"task_name":"GPU"}],"methods":[{"method_slug":null,"method_name":"Library"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2207.09442","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2207.09442"}},"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":"deterministic:regex_extraction","url":"https://github.com/facebookresearch/baspacho","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/facebookresearch/theseus","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":3},"by_repo_kind":{"listed":{"samples":3,"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":3,"samples":[{"code_sha256_prefix":"90f3d079af5c2da0","entry":"error_squared_norm_fn","repo":"facebookresearch/theseus","repo_kind":"listed","path":"theseus/core/objective.py","file_url":"https://github.com/facebookresearch/theseus/blob/HEAD/theseus/core/objective.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":false,"mcp_get_code":{"code_sha256":"90f3d079af5c2da0"}},{"code_sha256_prefix":"7e6f381964a728dc","entry":"lt_version","repo":"facebookresearch/theseus","repo_kind":"listed","path":"theseus/_version.py","file_url":"https://github.com/facebookresearch/theseus/blob/HEAD/theseus/_version.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":false,"mcp_get_code":{"code_sha256":"7e6f381964a728dc"}},{"code_sha256_prefix":"02ab830915d2aa99","entry":"masked_jacobians","repo":"facebookresearch/theseus","repo_kind":"listed","path":"theseus/core/cost_function.py","file_url":"https://github.com/facebookresearch/theseus/blob/HEAD/theseus/core/cost_function.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":false,"mcp_get_code":{"code_sha256":"02ab830915d2aa99"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}