The generation of GraphsGPT is controlled by multiple adjustable configurations. You can refer to the following descriptions to adjust the generation to different needs.
-
Auto-fix Toggle:
strict_generation
:(bool) True
(Whether to tolerate the validity exceptions during generation. Setting toFalse
will enable flexible generation that automatically fixes invalid predictions and ensure maximum effectiveness.)fix_aromatic_bond
:(bool) False
(Whether to fix the dissociative aromatic bonds in the generated molecules.)
-
Sampling Strategy:
do_sample
:(bool) False
(Whether to use probabilistic sampling for bond predictions. Setting toTrue
will enable probabilistic sampling and introduce more randomness.)top_k
:(int) None
(The range of top predictions for probability sampling. Available whendo_sample
isTrue
.)temperature
:(float) 1.0
(Temperature to adjust the probability distribution. Available whendo_sample
isTrue
.)
-
Hyperparameters:
max_atoms
:(int) None
(The maximum number of atoms for generation.)similarity_threshold
:(float) 0.5
(Threshold for classifying whether a generated atom is new or old.)
-
Other Check Terms:
check_first_node
:(bool) True
(Whether to check the consistency between the predicted beginning atom and the first bond, and fix the order of the beginning two atoms.)check_atom_valence
:(bool) False
(Whether to check the validity regarding the valence of the atoms connected to the predicted bonds.)
For reference, we provide some example configurations to use under different circumstances.
To validate the pretraining performance, the generation should be of no randomness, both auto-fix and probabilistic sampling should be turned off:
strict_generation="True"
fix_aromatic_bond="False"
do_sample="False"
check_first_node="True"
check_atom_valence="False"
An example script can be found in scripts/generation/unconditional/examples/generate_strict.sh
.
Upon generation of more effective results. You can turn on the auto-fix:
strict_generation="False"
fix_aromatic_bond="True"
do_sample="False"
check_first_node="True"
check_atom_valence="False"
An example script can be found in scripts/generation/unconditional/examples/generate_flexible.sh
.
To generate more diverse results. You can further turn on the probabilistic sampling and valence check. This requires the encoded Graph Words
strict_generation="False"
fix_aromatic_bond="True"
do_sample="True"
top_k=4
temperature=1.0
check_first_node="True"
check_atom_valence="True"
Run scripts/generation/unconditional/visualize.sh
.