neural differential equations
Project description
neural-diffeqs
Instantiate neural differential equations
Installation
To install with pip:
pip install neural_diffeqs
To install the development verison:
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_dim
mu_out_dim
mu_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_function
mu_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_dim
sigma_out_dim
sigma_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_function
sigma_dropout
There are also general parameters that are passed / required of the SDE when using the torchsde
interface:
brownian_size
noise_type
sde_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
Hashes for neural_diffeqs-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11d6527e02c46121f737ae6e9616eb22de2843f4642e5189529c3b5fba038097 |
|
MD5 | 685e838c76c20ef75bbd0f6d34054765 |
|
BLAKE2b-256 | cb6d1263d42ef9b0e6b991464011ffd6a1c834ee2572150ab4a21087b5c5f9b2 |