# facebookresearch/theseus

A library for differentiable nonlinear optimization

Repository: https://github.com/facebookresearch/theseus
Canonical: https://ross.abutalabs.com/products/facebookresearch-theseus
Language: Python
License: MIT
License Family: permissive
Topics: differentiable-optimization, robotics, embodied-ai, nonlinear-least-squares, pytorch, deep-learning, computer-vision, gauss-newton, levenberg-marquardt, implicit-differentiation, bilevel-optimization
Last push: 2025-01-16T17:47:06+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 1, release rhythm 8, longevity 100
- inputs: {"age_days": 1749, "days_push": 594, "days_rel": 721, "gap_med": null, "n_releases_24m": 1}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2055, forks 148 (observed 2026-08-28T04:06:09.782081+00:00)

## What it is
Theseus is a PyTorch-based library for building custom differentiable nonlinear optimization layers, supporting problems in robotics and vision as end-to-end differentiable architectures. It combines neural models with expert domain-specific differentiable models, differentiating through optimizers like Gauss-Newton and Levenberg-Marquardt.

## Use cases
- differentiate through nonlinear least squares solvers in pytorch
- build end-to-end differentiable optimization layers for robotics
- train neural networks with optimization-based inductive priors
- solve bundle adjustment with gradients flowing to neural components
- implement bilevel optimization with implicit differentiation
- combine learned models with expert differentiable cost functions

## When to choose
- you need gradients through an optimizer inside a PyTorch training loop
- you work on robotics or vision problems like SLAM, pose estimation, or bundle adjustment
- you want to embed domain priors as differentiable cost functions alongside neural networks

## When to avoid
- you need a general-purpose standalone nonlinear optimizer without gradients
- your project does not use PyTorch
- you need real-time embedded optimization without a deep learning framework

## Facets
- artifact type: library
- maturity: active
- function: machine-learning, deep-learning, simulation, math
- domain: robotics, computer-vision, machine-learning, deep-learning
- platform: python, cross-platform
- tags: differentiable-optimization, nonlinear-least-squares, pytorch, gauss-newton, levenberg-marquardt, implicit-differentiation, bilevel-optimization, embodied-ai, factor-graphs, algorithms, gpu

## Member repositories
- facebookresearch/theseus (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:09.782081+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:57:15.908073+00:00, confidence not recorded.
  - readme: https://github.com/facebookresearch/theseus (fetched 2026-08-28T04:06:09.782081+00:00, sha c17c85c90071)
- Data as of 2026-08-30T08:39:29.467469+00:00.
