Skip to content

Latest commit

 

History

History
40 lines (27 loc) · 988 Bytes

README.md

File metadata and controls

40 lines (27 loc) · 988 Bytes

torchdde

torchdde is a library that provides numerical solvers in Pytorch for Delay Differential Equations (DDEs) with constant delays.

Installation

pip install torchdde

or locally

git clone https://github.com/thibmonsel/torchdde.git
pip install torchdde/

Documentation

Github pages hosts the documentation at : https://thibmonsel.github.io/torchdde/

To generate the documentation locally, please look at CONTRIBUTING.MD.

Quick example

import torch
from torchdde import integrate, RK2

def f(t, y, args, history):
    return y * (1 - history[0])

solver = RK2()
delays = torch.tensor([1.0])
history_values = torch.arange(1, 5).reshape(-1, 1)
history_function = lambda t: history_values
solution = integrate(f, solver, ts[0], ts[-1], ts, y0, None, dt0=ts[1]-ts[0], delays=delays)