Coder Social home page Coder Social logo

zichaolong / pde-net Goto Github PK

View Code? Open in Web Editor NEW
302.0 14.0 105.0 246 KB

PDE-Net: Learning PDEs from Data

machine-learning applied-mathematics inverse-problems data-driven-model data-assimilation system-identification partial-differential-equations numerical-methods

pde-net's People

Contributors

zichaolong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pde-net's Issues

HCudaCheck FAIL

Some issues with the install/run. Here is what I am doing after downloading the repository and aTEAM-0.1, which I rename into aTEAM (as was suggested).

conda create -n PDE-Net python=3.6
source activate PDE-Net

conda install jupyter
conda install scipy
conda install pyyaml
conda install pytorch torchvision -c pytorch

When running the

python learn-variantcoelinear2d.py

HCudaCheck FAIL file=/opt/conda/conda-bld/pytorch_1532579805626/work/aten/src/THC/THCGeneral.cpp line=74 error=30 : unknown error Traceback (most recent call last):
File "learn_variantcoelinear2d.py", line 36, in <module> namestobeupdate, callback, linpdelearner = linpdeconfig.setenv(options)
File "/home/vgyrya/ML/PDE-Net/linpdeconfig.py", line 211, in setenv linpdelearner.cuda(namestobeupdate['gpu'])
File "/home/vgyrya/.conda/envs/PDE-Net/lib/python3.6/site-packages/torch/nn/modules/module.py", line 258, in cuda return self._apply(lambda t: t.cuda(device))
File "/home/vgyrya/.conda/envs/PDE-Net/lib/python3.6/site-packages/torch/nn/modules/module.py", line 185, in _apply module._apply(fn)
File "/home/vgyrya/.conda/envs/PDE-Net/lib/python3.6/site-packages/torch/nn/modules/module.py", line 185, in _apply module._apply(fn)
File "/home/vgyrya/.conda/envs/PDE-Net/lib/python3.6/site-packages/torch/nn/modules/module.py", line 185, in _apply module._apply(fn)
File "/home/vgyrya/.conda/envs/PDE-Net/lib/python3.6/site-packages/torch/nn/modules/module.py", line 197, in _apply self._buffers[key] = fn(buf)
File "/home/vgyrya/.conda/envs/PDE-Net/lib/python3.6/site-packages/torch/nn/modules/module.py", line 258, in <lambda> return self._apply(lambda t: t.cuda(device))
RuntimeError: cuda runtime error (30) : unknown error at /opt/conda/conda-bld/pytorch_1532579805626/work/aten/src/THC/THCGeneral.c pp:74

Timeout during printing the current expression

I am getting a timeout during the training of the burger's equation. This timeout is during the printing
of the coefficients. Also, some of the losses has become NaNs. Below is the snippet of the output

finally, finish this stage
iter:   345    time: 10.09
Func: 2.71e+03  |g|: 3.76e+02
stableloss: 1.29e+02   dataloss: 2.71e+03   sparseloss: 5.60e+02 momentloss: 7.27e+00
current expression:
Time out
block:  1
name:  test
device:  cuda:0
generate a random number to check random seed:  -0.7672237767185355

Error while training

I am getting indention error while running from anaconda prompt. I am using python 3.7
the error is -

(base) C:\Users\Z0042ZNU\Downloads\PDE-Net-PDE-Net-2.0>python train.py
Traceback (most recent call last):
  File "train.py", line 10, in <module>
    import conf,setenv,initparameters
  File "C:\Users\Z0042ZNU\Downloads\PDE-Net-PDE-Net-2.0\setenv.py", line 8, in <module>
    import conf,transform,setcallback
  File "C:\Users\Z0042ZNU\Downloads\PDE-Net-PDE-Net-2.0\setcallback.py", line 21
    """self.stage: a descriptor(str type) of current training stage"""
                                                                     ^
IndentationError: expected an indented block

I tried formating using sublime and vs code but the errors are too many and unresolved. Help required!

Using my own Data

Hello,

I've gotten the training, testing and plotting to work on my own set-up and have recreated your results. I see that the data PDE-Net is trained with is generated in the pdedata.py file. What is the best way to incorporate my own data and how do I feed it to PDE-Net?

Additionally, in PDE-Net 2.0 it is demonstrated that an actual equation can be output. How can I get PDE-Net to output the approximate PDE? Is there code available for PDE-Net 2.0?

Optimization Method

I was wondering why did you use BFGS optimization instead of inbuilt ADAM/Gradient descent
optimization method in pytorch?

Is the loss changed to the net?

In your paper, the moment loss is the regularization to make the moment matrix. But in your network, if I use order 1 or 2, the moment matrix is exactly zero. It seems the momentloss in the loss won't change. And if I did not misunderstand the code, the code uses the moment matrix to generate the kernel matrix?

For 1D dependency

I have data that is dependent only on the x-direction and not on the y-direction. How do I modify the code? Will I have to do it using 1D convolutions?

AssertionError: Torch not compiled with CUDA enabled

I followed the readme installing the required documentation but when executing

python train.py --name=${casename} --configfile=checkpoint/${casename}/options.yaml

got this error:

Traceback (most recent call last):
  File "train.py", line 57, in <module>
    globalnames, callback, model, data_model, sampling, addnoise = setenv.setenv(options)
  File "/net/nfs/ssd1/gmiloshe/PDE-Net/setenv.py", line 68, in setenv
    globalnames, callback, model = _set_model(options)
  File "/net/nfs/ssd1/gmiloshe/PDE-Net/setenv.py", line 45, in _set_model
    model.to(globalnames['device'])
  File "/net/nfs/ssd1/miniconda3/envs/PDE-Net-2/lib/python3.7/site-packages/torch/nn/modules/module.py", line 386, in to
    return self._apply(convert)
  File "/net/nfs/ssd1/miniconda3/envs/PDE-Net-2/lib/python3.7/site-packages/torch/nn/modules/module.py", line 193, in _apply
    module._apply(fn)
  File "/net/nfs/ssd1/miniconda3/envs/PDE-Net-2/lib/python3.7/site-packages/torch/nn/modules/module.py", line 193, in _apply
    module._apply(fn)
  File "/net/nfs/ssd1/miniconda3/envs/PDE-Net-2/lib/python3.7/site-packages/torch/nn/modules/module.py", line 205, in _apply
    self._buffers[key] = fn(buf)
  File "/net/nfs/ssd1/miniconda3/envs/PDE-Net-2/lib/python3.7/site-packages/torch/nn/modules/module.py", line 384, in convert
    return t.to(device, dtype if t.is_floating_point() else None, non_blocking)
  File "/net/nfs/ssd1/miniconda3/envs/PDE-Net-2/lib/python3.7/site-packages/torch/cuda/__init__.py", line 162, in _lazy_init
    _check_driver()
  File "/net/nfs/ssd1/miniconda3/envs/PDE-Net-2/lib/python3.7/site-packages/torch/cuda/__init__.py", line 75, in _check_driver
    raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled

Train PDE-Net using CPU

Hi! Thank you for reading this!

While running your code, I got following error:

$ python learn_variantcoelinear2d.py
Traceback (most recent call last):
File "learn_variantcoelinear2d.py", line 36, in
namestobeupdate, callback, linpdelearner = linpdeconfig.setenv(options)
File "/Users/Downloads/PDE_NET/PDE-Net/linpdeconfig.py", line 210, in setenv
linpdelearner.cuda(namestobeupdate['gpu'])
File "/Users/anaconda3/envs/pdenet/lib/python3.6/site-packages/torch/nn/modules/module.py", line 258, in cuda
return self._apply(lambda t: t.cuda(device))
File "/Users/anaconda3/envs/pdenet/lib/python3.6/site-packages/torch/nn/modules/module.py", line 185, in _apply
module._apply(fn)
File "/Users/anaconda3/envs/pdenet/lib/python3.6/site-packages/torch/nn/modules/module.py", line 185, in _apply
module._apply(fn)
File "/Users/anaconda3/envs/pdenet/lib/python3.6/site-packages/torch/nn/modules/module.py", line 185, in _apply
module._apply(fn)
File "/Users/anaconda3/envs/pdenet/lib/python3.6/site-packages/torch/nn/modules/module.py", line 197, in _apply
self._buffers[key] = fn(buf)
File "/Users/anaconda3/envs/pdenet/lib/python3.6/site-packages/torch/nn/modules/module.py", line 258, in
return self._apply(lambda t: t.cuda(device))
RuntimeError: Cannot initialize CUDA without ATen_cuda library. PyTorch splits its backend into two shared libraries: a CPU library and a CUDA library; this error has occurred because you are trying to use some CUDA functionality, but the CUDA library has not been loaded by the dynamic linker for some reason. The CUDA library MUST be loaded, EVEN IF you don't directly use any symbols from the CUDA library! One common culprit is a lack of -Wl,--no-as-needed in your link arguments; many dynamic linkers will delete dynamic library dependencies if you don't depend on any of their symbols. You can check if this has occurred by using ldd on your binary to see if there is a dependency on *_cuda.so library.

I was wondering whether I can train a PDE-Net using CPU? Or it will be preferred to get a CUDA GPU to run this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.