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/
user@machine:~$ conda env create -f env.yml
(neuromancer) user@machine:~$ source activate neuromancer
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
(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
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
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
trained models test trained models - beaware there is offset due to poor initialization of trained model, shall work ok though