# Create the environment

```
conda create -n safe -y python=3.8
pip install -r requirements.txt
pip install -r exp_utils/requirements.txt
```


# How to run the code

Example: `Move`.

1. train an init policy: `python run/mf_td3.py --log_dir /tmp/move --param configs/cartpole/move.json5`
2. train a model: `python run/main.py  --log_dir /tmp/move --param configs/cartpole/all.json5 configs/cartpole/move.json5 --task safe-init --ckpt.policy /tmp/move/0/ckpt-<xxx>.pt`
3. train an inititial L: `python run/main.py --log_dir /tmp/move --param configs/cartpole/all.json5 configs/MALA.json5 --task pretrain_L --ckpt.policy /tmp/move/0/ckpt-<xxx>.pt --ckpt.models /tmp/move/1/final.pt`
4. train the policy: `python run/main.py --log_dir /tmp/move --param configs/cartpole/all.json5 configs/MALA.json5 configs/cartpole/move.json5 --task unified-new-algo --ckpt.policy /tmp/move/0/ckpt-<xxx>.pt --ckpt.models /tmp/move/1/final.pt --ckpt.L /tmp/move/2/ckpt-<yyy>.pt`
