# PolyRetro: Few-shot Polymer Retrosynthesis via Domain Adaptation
   
## Conda/Python Environment

Please install the following dependencies in your python environment:
1. Python 3.x;
2. Pytorch 1.4+;
3. RDkit;
4. Tqdm;
5. Scikit Learn;
6. (*optional, for visualization) Seaborn.

    
## Extra Dependencies

For each folder under ```packages/```, do

    pip install -e .
    
## Prepare Cooked Data

Download cooked data from the following dropbox link and unzip it in the current directory.

https://www.dropbox.com/s/8gzw0ei0e1ql91e/polyretro-data.zip?dl=0



## Run Real Polymer Experiments

```cd``` to current directory, run the experiments with,

    python test_real_polymers.py --alg polyretro
    python test_real_polymers.py --alg uspto
    python test_real_polymers.py --alg random
    
To visualize the results, run,

    python plot_results.py