MCMG: multi-constraints molecular generation approach based on conditional transformer and reinforcement learning
The default task of our code is to generate molecules of task 1 in paper(DRD2+QED+SA). Users can customize their own tasks by modifying the code. Users can run the MCMG model by excuting the 1-4 .py files in sequence according to the following script.
python 1_train_prior_Transformer.py --train-data {your_training_data_path} --valid-data {your_valid_data_path} --save-prior-path {path_to_save_prior_model}
python 2_generator_Transformer.py --prior {piror_model_path} --save_molecules_path {save_molecules_path}
python 3_train_middle_model_dm.py --train-data {your_training_data_path} --save-middle-path {path_to_save_middle_model}
python 4_train_agent_save_smiles.py --num-steps 5000 --batch-size 128 --middle {path_of_middle_model} --agent {path_to_save_agent_model} ---save-file-path{save_smiles}