dig.ggraph3D.evaluation

Evaluation interfaces under dig.ggraph3D.evaluation.

PropOptEvaluator

Evaluator for targeted molecule discovery task.

RandGenEvaluator

Evaluator for random generation task.

class PropOptEvaluator(prop_name='gap', good_threshold=4.5)[source]

Evaluator for targeted molecule discovery task. Metric is the mean, optimum, and good percentage of property scores among generated molecular geometries.

Parameters
  • prop_name (str) – A string indicating the name of the molecular property, use ‘gap’ for HOMO-LUMO gap or ‘alpha’ for isotropic polarizability. (default: gap)

  • good_threshold (float) – The threshold used to identifying whether a property score is good or not. Use 4.5 for HOMO-LUMO gap, and lower than 4.5 is considered as good. Use 91 for isotropic polarizability, and higher than 91 is considered as good.

eval(mol_dicts)[source]

Run evaluation in the targeted molecule discovery task.

Parameters

mol_dicts (dict) – A python dict where the key is the number of atoms, and the value indexed by that key is another python dict storing the atomic number matrix (indexed by the key ‘_atomic_numbers’) and the coordinate tensor (indexed by the key ‘_positions’) of all generated molecular geometries with that atom number.

Return type

dict a python dict with the following items: mean — the mean of property scores; best — the optimum of property scores, it is the lowest value for HOMO-LUMO gap, and the highest value for isotropic polarizability; good_per — the good percentage of property scores.

class RandGenEvaluator[source]

Evaluator for random generation task. Metric is the chemical validity ratio (represented in percentage) and the MMD distances of bond length distribution between the generated molecular geometries and those in the dataset.

static eval_bond_mmd(input_dict)[source]

Run evaluation in random generation task. Compute the MMD distances of bond length distribution between the generated molecular geometries and those in the dataset.

Parameters

input_dict (dict) – A python dict with the following items: “mol_dicts” — A python dict where the key is the number of atoms, and the value indexed by that key is another python dict storing the atomic number matrix (indexed by the key ‘_atomic_numbers’) and the coordinate tensor (indexed by the key ‘_positions’) of all generated molecular geometries with that atom number. “target_bond_dists” — A python dict where the key is the bond type, and the value indexed by that key is the list of all lengths of that bond in the dataset.

Return type

dict a python dict where the key is the bond type, and the value indexed by that key is the MMD distance metric of that bond.

static eval_validity(mol_dicts)[source]

Run evaluation in random generation task. Compute the chemical validity ratio (represented in percentage).

Parameters

mol_dicts (dict) – A python dict where the key is the number of atoms, and the value indexed by that key is another python dict storing the atomic number matrix (indexed by the key ‘_atomic_numbers’) and the coordinate tensor (indexed by the key ‘_positions’) of all generated molecular geometries with that atom number.

Return type

dict a python dict with the following items: “valid_ratio” — chemical validity percentage;