
## Requirements

To install requirements:

```setup
pip3 install -r requirements.txt
```

## Training
**Before training and evaluating, you have to replace all {Absolute Path put QAvatar} in the following command with your own absolute path which you put QAvatar in.**

At first, run this command to train the source model and collect the source-domain data:

```train
cd {Absolute Path put QAvatar}/QAvatar/source/
python3 train_src_model_mujoco --seed 1 --device 'cuda:0' --folder '{Absolute Path put QAvatar}/QAvatar/' --env 'HalfCheetah-v3' 
python3 data_collect_mujoco.py --seed 1 --folder '{Absolute Path put QAvatar}/QAvatar/' --env 'HalfCheetah-v3'
```

Secondly, run this command to train the normalizing flow model in the paper:
```train
cd {Absolute Path put QAvatar}/QAvatar/source/flowpg
python -m experiments.train_flow_state --seed 1 --device 'cuda:0' --folder '{Absolute Path put QAvatar}/QAvatar/'
python -m experiments.train_flow_action --seed 1 --device 'cuda:0' --folder '{Absolute Path put QAvatar}/QAvatar/'
```

Thirdly, run this command to train the target-domain model in the paper:
```train
cd {Absolute Path put QAvatar}/QAvatar/target/
python3 train_target_model.py --seed 1 --device 'cuda:0' --src_file 'cheetah.xml' --tar_file 'cheetah_target.xml' --src_env 'HalfCheetah-v3' --tar_env 'HalfCheetah-v3' --folder '{Absolute Path put QAvatar}/QAvatar/'
```
