Giter Club home page Giter Club logo

flexyairdeepmpc's Introduction

NeuroMANCER

Neural Modules with Adaptive Nonlinear Constraints and Efficient Regularizations

UML diagram

Setup

Clone and install neuromancer, linear maps, and emulator packages
user@machine:~$ mkdir ecosystem; cd ecosystem
user@machine:~$ git clone https://stash.pnnl.gov/scm/deepmpc/neuromancer.git
user@machine:~$ git clone https://stash.pnnl.gov/scm/deepmpc/psl.git
user@machine:~$ git clone https://stash.pnnl.gov/scm/deepmpc/slim.git

# Resulting file structure:
    ecosystem/
        neuromancer/
        psl/
        slim/
Create the environment via .yml (Linux)
user@machine:~$ conda env create -f env.yml
(neuromancer) user@machine:~$ source activate neuromancer
If .yml env creation fails create the environment manually
user@machine:~$ conda config --add channels conda-forge pytorch
user@machine:~$ conda create -n neuromancer python=3.7
user@machine:~$ source activate neuromancer
(neuromancer) user@machine:~$ conda install pytorch torchvision cudatoolkit=10.2 -c pytorch
(neuromancer) user@machine:~$ conda install scipy pandas matplotlib control pyts numba scikit-learn mlflow dill
(neuromancer) user@machine:~$ conda install -c powerai gym
install neuromancer ecosystem
(neuromancer) user@machine:~$ cd psl
(neuromancer) user@machine:~$ python setup.py develop
(neuromancer) user@machine:~$ cd ../slim
(neuromancer) user@machine:~$ python setup.py develop
(neuromancer) user@machine:~$ cd ../neuromancer
(neuromancer) user@machine:~$ python setup.py develop

Run System ID and Control Scripts

System ID

flexy dataset path: Flexy_air

to train system ID on flexy dataset run: system_id_flexy

good choice of hyperparameters for system ID:

python system_id.py -system flexy_air -epochs 1000 -nx_hidden 20 -ssm_type blackbox -state_estimator mlp -nonlinear_map residual_mlp -n_layers 2 -nsim 10000 -nsteps 32 -lr 0.001
Control

to train control policy with learned state space model for flexy dataset run: base_control_flexy.py

good choice of hyperparameters for control:

python control_flexy -system flexy_air -epochs 1000 -nx_hidden 20 -ssm_type blackbox -n_layers 4 -nsim 10000 -nsteps 10 -lr 0.001 -policy_features ['x0_estim', 'Rf', 'Df']

stored trained pytorch models for system ID and control: Flexy_air

test policy in an exposed closed loop for HW implementation test_policy_flexy.py

Flexy trained policies

trained models test trained models - beaware there is offset due to poor initialization of trained model, shall work ok though

flexyairdeepmpc's People

Contributors

drgona avatar aarontuor avatar

Stargazers

 avatar

Watchers

James Cloos avatar Nathan Baker avatar  avatar  avatar Martin Klauco avatar Leif Carlsen avatar  avatar  avatar  avatar

Forkers

tubbz-alt

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.