neural differential equations
Project description
A PyTorch-based library for the instantiation of neural differential equations.
Installation
To install with pip:
pip install neural_diffeqs
To install the development version from GitHub:
git clone https://github.com/mvinyard/neural-diffeqs.git; cd ./neural-diffeqs
pip install -e .
Examples
You can instantiate an SDE or ODE as follows:
from neural_diffeqs import neural_diffeq
SDE = neural_diffeq()
# this can be passed to `torchsde.sdeint`
ODE = neural_diffeq(sigma_hidden=False)
# this can be passed to `torchdiffeq.odeint`
You can also define the SDE or ODE as potential functions. These can be passed to torchsde.sdeint and torchdiffeq.odeint just the same as above:
from neural_diffeqs import neural_diffeq
SDE = neural_diffeq(mu_potential=True, sigma_potential=False)
ODE = neural_diffeq(sigma_hidden=False)
There are several other parameters that are easily tweakable, including the composition of the neural network(s), using the following arguments:
To adjust the parameters of the mu neural network:
mu_hidden- adict(e.g.,:{1:[400,400], 2:[400,400]})mu_in_dimmu_out_dimmu_potential- if this parameter isTrue, the output dimension of the output layer is changed to1.mu_init_potential- whenmu_potential = True, this argument initializes the output value ofmu. By default, this returns atorch.zeros([])tensor.mu_activation_functionmu_dropout
Similarly, the sigma neural network can be controlled with these parameters:
sigma_hidden- adict(e.g.,:{1:[400,400], 2:[400,400]})sigma_in_dimsigma_out_dimsigma_potential- if this parameter isTrue, the output dimension of the output layer is changed to1.sigma_init_potential- whensigma_potential = True, this argument initializes the output value ofsigma. By default, this returns atorch.zeros([])tensor.sigma_activation_functionsigma_dropout
There are also general parameters that are passed / required of the SDE when using the torchsde interface:
brownian_sizenoise_typesde_type
For more examples, please see the notebooks in ./examples/. For documentation related neural ODEs and torchdiffeq, see the torchdiffeq repository. For documentation related to neural SDEs and torchsde, see the torchsde repository.
Questions or suggestions? Open an issue or send an email to Michael Vinyard.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file neural-diffeqs-0.0.31.tar.gz.
File metadata
- Download URL: neural-diffeqs-0.0.31.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a89f609d8703d17ee2f4cdaf5ab20f4ce3725d0a4607d34df974bfa1ba5109a
|
|
| MD5 |
d02f05160ff595da1f7ed11d69dadf9b
|
|
| BLAKE2b-256 |
73bffe8a99b6cc06137bfc539c864629d9a9f68721a133f883b31986d54f863a
|
File details
Details for the file neural_diffeqs-0.0.31-py3-none-any.whl.
File metadata
- Download URL: neural_diffeqs-0.0.31-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38c582791e364b77f4adcf928eb85d7eaab742e0b0aee46df9dddf9df48bd371
|
|
| MD5 |
082f6738a1960fee0433ccf4674c7e58
|
|
| BLAKE2b-256 |
c4e4a94444a07821c5bda16cb974cac5dc478905d698ba82b7ed55a8a68decc6
|