DIDGen Parameters

June 4, 2024 ยท View on GitHub

Here is a list of parameters for DIDgen. They can be input as a single yaml file and as a python dictionary in the python API. You only need to specify the parameters that you want to change from default. The full list of parameters and their default value can be found in didgen/config.py.

Training and datasets

ParameterTypeDefaultDescription
propertylist of int[4]Index of the property to optimize in the dataset features. Multiple properties can be selected at once. e.g., 4 is the index of the HOMO-LUMO gap property in PyG QM9
type_listlist of str['H', 'C', 'N', 'O', 'F']Atomic ordering in the dataset one-hot encoding
max_sizeint25Maximum molecular size to train on and to generate (including hydrogen atoms)
n_dataint1000Size of the dataset to use, if larger than the size of the dataset, all the data is used
datasetslist of str['qm9']Datasets to train on. 'qm9' will download PyG QM9 otherwise DIDgen will look in OUTDIR/dataset_name for a QM9like dataset (more on this coming soon, including scripts to use your own datasets)
num_epochsint400Number of epochs
batch_sizeint30Batch size
learning_ratefloat0.001Learning rate (Adam optimizer)
noise_factorfloat0.05Random noises added to input vectors to make the model less sensitive to non-integers (often not necessary)
use_pretrainedboolFalseWhether to reuse weights from previous run, useful when generating molecules without having to retrain. Weights are saved in OUTDIR/model_weights.pth.

Model

ParameterTypeDefaultDescription
modelstrSimpleNetModel to train and generate with. Current options are: "SimpleNet", "CrippenNet" and "CGCNN"
layer_listlist of int[128]List and size of MLP layers after the convolutions. e.g. [128,128,50] would be 3 layer MLP. Only available for "SimpleNet" and "CrippenNet"
atom_fea_lenint20Size of the atomic embedding before and during the convolutions
n_convint3Number of convolutions
weight_decayint0Weight decay as implemented in Pytorch Adam optimizer
dropoutint0Dropout rate before each linear layer. Only available for "SimpleNet" and "CrippenNet"
show_trainboolFalseWhether to display and plot training statistics.
atom_classboolFalseWhether to train on atomic classification. Only available for CrippenNet. Note that CrippenNet can be trained as a repressor.

Generation

ParameterTypeDefaultDescription
targetlist of float[4.1]Target value of the property. e.g. An energy gap of 4.1 eV
proportionslist of float[0.411, 0.3026, 0.0602, 0.0735, 0.0015]Target proportion between different elements following type_list. This is set as loose criteria (see stop_prop)
stop_lossfloat0.3Stopping criteria for the property target. DIDgen stops when the value is within stop_loss of target
stop_propint100Stopping criteria for element proportions. Set such that criteria is always met. Could be useful to generate isomers.
bondinglist of int[1, 4, 3, 2, 1]Valence of each element in type_list
min_sizeint5Minimum size of generated molecules
start_fromstr!Molecular representation to start from. Options are: "random" to start from random noise, "saved" to reuse the previous starting point, "!" to start from a random entry in the dataset and id to start from a molecule with index id in the dataset.
starting_sizeint25Maximum starting size when starting from random noise
n_iterint300Maximum number of iterations to reach the target
inv_rfloat0.01Rate of gradient descent (Adam optimizer)
l_lossfloat0.01Relative importance of the target property loss (see equation 2 in the manuscript)
l_propint100Relative importance of the elemental proportion loss
show_lossesboolFalseWhether to display and plot optimization statistics (slow)
max_attemptsint3Maximum number of attempts (starts) to reach the target
bond_multiplierfloat0.3Magnitude of the random noise when using start_from; "random". Larger magnitude creates more bonds.
embedboolTrueWhether to find a conformer (3D atomic positions) for the generated molecule