Code Monkey home page Code Monkey logo

pde's Introduction

Collection of various PDE related work.

PDE-Refiner Slides

Use quarto preview pde-refiner.ipynb to preview the Reveal.js slides in a browser window while making changes.

PDE-Refiner Repro

Notes on attempt to reproduce PDE-Refiner for Kuramoto-Sivashinsky. Was not able to reproduce > 90s rollout with > 0.8 correlation, but this is a start.

Generate Training Data

To generate the data download this repo and install the conda environment: https://github.com/brandstetter-johannes/LPSDA

Then run ./generate-ks.sh. This takes 3 days to run on a M2 Pro. Then make a copy of the training dataset for each GPU you will train on.

Training

Download https://github.com/pdearena/pdearena, install the conda environement inside of docker/ then add this to training config for Kuramoto-Sivashinsky so we get checkpoints:

+    - class_path: pytorch_lightning.callbacks.ModelCheckpoint
+      init_args:
+        monitor: 'train/loss_mean'
+        save_top_k: 1
+        verbose: True
+        save_last: True
+        dirpath: ${trainer.default_root_dir}/ckpts
+        filename: "epoch_{epoch:03d}"
+        auto_insert_metric_name: False
+        save_on_train_epoch_end: True

Then can run ./train.sh this takes 3 hours on 8x A100s or 2 days on V100.

Evaluation

Can use evaluation.ipynb to save ground truth and inference tensors to disk then use poster_plots.ipynb to generate the comparison images and correlation plots.

For testing add this diff to pdearena to force using the train dataset for testing (they use 140 for training and the rest of the trajectory for test).

             with h5py.File(path, "r") as f:
-                data_h5 = f[self.mode]
+                data_h5 = f["train"] # f[self.mode]
                 data_key = [k for k in data_h5.keys() if k.startswith("pde_")][0]
                 data = {
                     "u": torch.tensor(data_h5[data_key][:].astype(self.dtype)),
@@ -140,7 +140,7 @@ def _valid_filter(fname):

 def _test_filter(fname):
-    return "_test_" in fname and "h5" in fname
+    return "_train_" in fname and "h5" in fname

pde's People

Contributors

davidwagnerkc avatar

Watchers

 avatar

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.