Learning Partial Differential Equations
Project description
Learning Partial Differential Equations
INSTALLATION
Via pip:
pip install lpde
Via source
git clone https://github.com/fkemeth/lpde
cd lpde
pip install .
USAGE
This python package contains functions to learn partial differential equations (PDE) from data.
-
The main components consists of a neural network PDE class
Network(torch.nn.Module)
. To create an instance of this class, one needs to pass a config dictionary that specifieskernel_size
: The width of the finite difference stencil used to calculate input spatial derivativesn_derivs
: The number of derivatives used in the PDE modeldevice
: Either 'cpu' or 'cudause_param
: Boolean that specifiesnum_params
: Ifuse_param
is True, then here the number of parameters that change have to be specified.n_filters
: The number of neurons in each layer of the PDE model.n_layers
: The number of layers of the PDE model.
In addition, the number of system variables
n_var
has to be provided -
Furthermore, a model wrapper to train and evaluate the neural network PDE is provided as a
Model
class. To create an instance of this class, one needs to providedataloader_train
: A pytorch dataloader with the training datadataloader_val
: A pytorch dataloader with the validation datanetwork
: A Network instance, as described aboveconfig
: A config dictionary containinglr
: The initial learning ratepatience
: The patience used for the learning rate schedulerreduce_factor
: - The factor by whicg the learning rate is reduced when loss does not decreaseweight_decay
: - Weight decay factor for regularization
path
: String to the directory where the trained model shall be saved
See this GitHub repo for example usages.
ISSUES
For questions, please contact (felix@kemeth.de), or visit the GitHub repo.
LICENCE
This work is licenced under MIT License. Please cite
"Learning emergent partial differential equations in a learned emergent space" F.P. Kemeth et al. (https://arxiv.org/abs/2012.12738)
if you use this package for publications.
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.