--- id: torchcde version: "0.2.5" license: Apache-2.0 license_treatment: permissive maintenance: aging --- # torchcde — Differentiable controlled differential equation solvers for PyTorch with GPU support and memory-efficient adjoint backpropagation. License: permissive · Maintenance: aging · Downloads: 84.4K/mo ## 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 above — 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 pip install torchcde uv add torchcde 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_current - Install friction: low - Maintenance: aging - Downloads: 84.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags neural controlled differential equations, CDE solvers PyTorch, irregular time series models, continuous time RNN, differentiable ODE solvers GPU, time series with missing data, adjoint backpropagation neural networks, time-series-modeling, differential-equations, gpu-accelerated [View on SkillFed](https://skillfed.io/packages/torchcde) · [View on PyPI](https://pypi.org/project/torchcde/)