skillfed

torchcde

Differentiable controlled differential equation solvers for PyTorch with GPU support and memory-efficient adjoint backpropagation.

torchcde v0.2.5 84.4K downloads/30d#14,004 on PyPI487
Permissive license Apache-2.0 AGING released

What it is and what it does

torchcde is a PyTorch library that implements solvers for controlled differential equations (CDEs), a mathematical framework for modeling systems where the evolution of state depends on an external control signal. It is designed specifically for neural network applications, enabling the construction of Neural Controlled Differential Equation models—continuous-time recurrent architectures that excel at handling irregular, variable-length time series with missing data.

The library provides two main components: integrators (the `cdeint` function) that solve the CDE system by computing how state evolves under a control signal, and interpolation schemes that construct smooth continuous controls from discrete, irregularly-sampled data. It supports both standard backpropagation through the solver and memory-efficient adjoint-method backpropagation, with configurable backends (torchdiffeq or torchsde) to leverage different solver implementations. GPU acceleration is built in through PyTorch.

Use it for:

  • Build time-series classifiers that handle irregular sampling, variable lengths, and missing values without preprocessing.
  • Model financial or sensor data where observations arrive at non-uniform time intervals.
  • Implement continuous-time recurrent models as an alternative to LSTMs or Transformers for sequential prediction.
  • Train state-space models where the dynamics are controlled by external signals or learned functions.
  • Perform adjoint-based training on large time-series datasets where memory efficiency is critical.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides differentiable GPU-capable solvers for controlled differential equations (CDEs), enabling Neural Controlled Differential Equation models for irregular time series with support for backpropagation and memory-efficient adjoint methods.

Yes, if you are working on irregular time-series modeling and want a principled continuous-time approach. The library is well-designed and permissively licensed. However, proceed with caution: the project is aging (last release October 2021, no recent commits), so compatibility with the latest PyTorch versions and long-term maintenance are uncertain. Verify that it works with your current environment before committing to production use.

Install

torchcde on PyPI

pip

pip install torchcde

uv

uv add torchcde

poetry

poetry add torchcde

Installing torchcde

Before you install

Low friction installation as a pure Python wheel. Maintenance is aging—last release was October 2021 and the repository shows no recent commits, though it remains unarchived with 487 stars. Depends on torch, torchdiffeq, and torchsde, all of which are established libraries.

License in practice

Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions. You may use, modify, and distribute the code provided you include a copy of the license and state significant changes.

Quickstart

pip install torchcde

import torch
import torchcde

# Interpolate discrete time series data
coeffs = torchcde.hermite_cubic_coefficients_with_backward_differences(x)
X = torchcde.CubicSpline(coeffs)

# Define CDE dynamics and integrate
z = torchcde.cdeint(X=X, func=func, z0=z0, t=X.interval)

Requires PyTorch >=1.7; Python ~=3.6 or later.

Verify before relying

  • Whether the aging maintenance status (last release October 2021, no recent commits) affects compatibility with current PyTorch versions or introduces unpatched issues.
  • Performance characteristics and memory overhead compared to alternative time-series models for specific use cases.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (~=3.6)
Install friction low — pure-Python wheel
Runtime dependencies 3 — torch, torchdiffeq, torchsde
Maintenance aging — 1,762 days since the last release
Last repo commit
First released
Downloads 84,351/month — #14,004 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: torchcde-0.2.5-py3-none-any.whl

Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Financial and Insurance IndustryIntended Audience :: Information TechnologyIntended Audience :: Science/ResearchLicense :: OSI Approved :: Apache Software LicenseNatural Language :: EnglishOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: UnixProgramming Language :: Python :: 3Programming Language :: Python :: Implementation :: CPythonTopic :: Scientific/Engineering :: Artificial IntelligenceTopic :: Scientific/Engineering :: Information AnalysisTopic :: Scientific/Engineering :: Mathematics

Tags

neural controlled differential equationsCDE solvers PyTorchirregular time series modelscontinuous time RNNdifferentiable ODE solvers GPUtime series with missing dataadjoint backpropagation neural networks
time-series-modelingdifferential-equationsgpu-accelerated

More Artificial Intelligence packages

Further reading