Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Zymrael/torchSODE
PyTorch block-diagonal ODE CUDA solver, designed for gradient-based optimization
https://github.com/Zymrael/torchSODE
Last synced: about 2 months ago
JSON representation
PyTorch block-diagonal ODE CUDA solver, designed for gradient-based optimization
- Host: GitHub
- URL: https://github.com/Zymrael/torchSODE
- Owner: Zymrael
- Created: 2019-04-10T23:43:31.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-27T11:43:42.000Z (over 4 years ago)
- Last Synced: 2024-11-08T02:35:53.090Z (about 2 months ago)
- Language: Jupyter Notebook
- Homepage:
- Size: 1.42 MB
- Stars: 16
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-neural-ode - repo
README
# torchSODE
CUDA solver callable from PyTorch. Optimized for independent ordinary differential equations (ODEs) that can be represented as a sparse block diagonal matrix.
The solver itself is designed to be used during neural network training and thus accepts an additional argument `grad`
## Installation
In your terminal of choice:
`git clone https://github.com/Zymrael/torchODE.git`
`cd torchSODE/src`
`python setup.py install`
In your python files or notebooks:
`import torchSODE`
## API
`torchSODE.solve(F, x0, grad, dt, steps, method='Euler')` performs `steps` integration cycles with `dt` step size.For problems where the size of x0 is too large allocating a matrix of dimensions size * size is not always possible. In these cases we assume a compressed representation of `F` which exposes only its diagonal values.
The following convention is used (regardless of problem size):
1. For diagonal `F` allocate a torch.Tensor of shape (1).
2. For 4 block-diagonal `F`, allocate a torch.Tensor of shape (2,2) with values of upper-left diagonal in position [0,0], upper-right diagonal [0,1], lower-left diagonal [1,0], lower-right diagonal [1,1].In any other scenario `torchSODE.solve` requires `x0.size(0)` to match `F.size(0)` and `F.size(1)`, with `F` assumed to be 4 block-diagonal.
### Methods
`'Euler'` = Euler`'RK4'` = Runge-Kutta 4