Giter VIP home page Giter VIP logo

l2d-learning-to-discretize's Introduction

Learning to Discretize: Solving 1D Scalar Conservation Laws via Deep Reinforcement Learning

This is the code for the paper "Learning to Discretize: Solving 1D Scalar Conservation Laws via Deep Reinforcement Learning", published at Communication in Computational Physics (CiCP) 2020. [Arxiv]. Authors: Yufei Wang*, Ziju Shen*, Zichao Long, Bin Dong (* indicates equal contribution)

Instructions

Preparation

  1. Create conda environment
conda env create -f environment.yml
  1. Activate the conda environment
source prepare.sh

Training

  1. Generate training datasets
python scripts/generate_solutions.py --prefix [PREFIX] --eta [ETA] --num [NUM]

to generate and store solutions to some randomly generated initial conditions. The solution files will be stored at data/local/solutions/prefix

  1. Perform training
python launchers/launch_td3.py

This will train a TD3 agent on the pre-generated solutions of different initial conditions in step 1.
Remember to change the solution_data_path variable to point to the correct path of the generated solutions in step 1.
You can tune the parameters in launch_td3.py.

The training logs will be stored at data/local/exp_prefix. exp_prefix is specified in launch_td3.py.
To view the training logs, you can use python viskit/frontend.py data/local/exp_prefix.
To make videos of the trained models, use scripts/make_videos.py
To make error tables of the trained models, use scripts/test_trained_model_mesh.py or scripts/test_trained_model_forcing.py or scripts/test_trained_model_viscous.py

l2d-learning-to-discretize's People

Contributors

yufeiwang63 avatar

Stargazers

 avatar Xiaozhe Zheng avatar  avatar Suraj Pawar avatar Yuhao avatar HaiFeng Wang avatar  avatar  avatar Jiawei Mao avatar  avatar  avatar Lianke Qin avatar 2prime avatar

Watchers

James Cloos avatar  avatar  avatar paper2code - bot 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.