|
1 |
| -# Conditional CGVAE |
| 1 | +# Conditional Constrained Graph Variational Autoencoders (CCGVAE) for Molecule Design |
| 2 | +This repository contains the code used to generate the results reported in the paper: [Conditional Constrained Graph Variational Autoencoders for Molecule Design](https://arxiv.org/abs/2009.00725). |
| 3 | + |
| 4 | +``` |
| 5 | +@article{rigoni2020conditional, |
| 6 | + title={Conditional Constrained Graph Variational Autoencoders for Molecule Design}, |
| 7 | + author={Rigoni, Davide and Navarin, Nicol{\`o} and Sperduti, Alessandro}, |
| 8 | + journal={arXiv preprint arXiv:2009.00725}, |
| 9 | + year={2020} |
| 10 | +} |
| 11 | +``` |
| 12 | + |
2 | 13 | All the files related to the CCGVAE model will be uploaded soon.
|
3 | 14 |
|
| 15 | +# Dependencies |
| 16 | +This project uses the `conda` environment. |
| 17 | +In the `root` folder you can find, for each model, the `.yml` file for the configuration of the `conda` environment and also the `.txt` files for the `pip` environment. |
| 18 | +Note that some versions of the dependencies can generate problems in the configuration of the environment. For this reason, although the `setup.bash` file is present for the configuration of each project, it is better to configure them manually. |
| 19 | + |
| 20 | +# Structure |
| 21 | +The project is structured as follows: |
| 22 | +* `data`: contains the code to execute to make the dataset; |
| 23 | +* `results`: contains the checkpoints and the results; |
| 24 | +* `model`: contains the code about the model; |
| 25 | +* `utils`: contains all the utility code. |
| 26 | + |
| 27 | +# Usage |
| 28 | +### Data Download |
| 29 | +First you need to download the necessary files and configuring the environment by running the following commands: |
| 30 | +```bash |
| 31 | +sh setup.bash install |
| 32 | +conda activate givae |
| 33 | +``` |
| 34 | + |
| 35 | +### Data Pre-processing |
| 36 | +In order to make de datasets type the following commands: |
| 37 | +```bash |
| 38 | +cd data |
| 39 | +python make_dataset.py --dataset [dataset] |
| 40 | +``` |
| 41 | +Where _dataset_ can be: |
| 42 | +* qm9 |
| 43 | +* zinc |
| 44 | + |
| 45 | + |
| 46 | +### Model Training |
| 47 | +In order to train the model use: |
| 48 | +```bash |
| 49 | +python CCGVAE.py --dataset [dataset] --config '{"generation":0, "log_dir":"./results", "use_mask":false}' |
| 50 | +``` |
| 51 | + |
| 52 | +### Model Test |
| 53 | +In order to generate new molecules: |
| 54 | +```bash |
| 55 | +python CCGVAE.py --dataset [dataset] --restore results/[checkpoint].pickle --config '{"generation":1, "log_dir":"./results", "use_mask":false}' |
| 56 | +``` |
| 57 | + |
| 58 | +While, in order to reconstruct the molecules: |
| 59 | +```bash |
| 60 | +python CCGVAE.py --dataset [dataset] --restore results/[checkpoint].pickle --config '{"generation":2, "log_dir":"./results", "use_mask":true}' |
| 61 | +``` |
| 62 | + |
| 63 | +In order to analyze the results, we used the following environmet: [ComparisonsDGM](https://github.com/drigoni/ComparisonsDGM). |
| 64 | + |
4 | 65 | # Information
|
5 | 66 | For any questions and comments, contact [Davide Rigoni ](mailto:[email protected]).
|
6 | 67 |
|
| 68 | +**NOTE:** Some functions are extracted from the following source [code](https://github.com/microsoft/constrained-graph-variational-autoencoder). |
| 69 | + |
7 | 70 | # Licenze
|
8 | 71 | MIT
|
| 72 | + |
0 commit comments