gt4sd.algorithms.controlled_sampling.advanced_manufacturing.implementation.nccr.core module

Catalyst design for NCCR project.

Summary

Classes:

CatalystBindingEnergyPredictor

Catalyst binding energy predictor for suzuki reactions.

CatalystGenerator

Catalyst generator.

CatalystVAE

Catalyst VAE for suzuki reactions.

Reference

class CatalystVAE(resources_path, padding_length=127, maximum_length=100, primer_smiles='', checkpoint_filename='epoch=199-step=5799.ckpt')[source]

Bases: Representation

Catalyst VAE for suzuki reactions.

__init__(resources_path, padding_length=127, maximum_length=100, primer_smiles='', checkpoint_filename='epoch=199-step=5799.ckpt')[source]

Constructs a CatalystVAE.

Parameters
  • resources_path (str) – directory where to find models and configurations.

  • pading_length – size of the padded sequence. Defaults to 127.

  • maximum_length (int) – maximum length of the synthesis.

  • primer_smiles (str) – primer SMILES representation. Default to “”, a.k.a., no primer.

  • checkpoint_filename (str) – checkpoint filename. Defaults to “epoch=199-step=5799.ckpt”.

model: GranularEncoderDecoderModel
smiles_to_latent(smiles)[source]

Encode a SMILES into a latent point.

Parameters

smiles (str) – a SMILES representation of a molecule.

Return type

Union[ndarray, Tensor, Series]

Returns

the encoded latent space point.

decode(z)[source]

Decode a catalyst from the latent space.

Parameters

z (Union[ndarray, Tensor, Series]) – a latent space point.

Return type

str

Returns

a catalyst in SMILES format.

__annotations__ = {'fixed_representation': 'Optional[torch.Tensor]', 'model': <class 'gt4sd.frameworks.granular.ml.models.base_model.GranularEncoderDecoderModel'>, 'z_dimension': 'int', 'z_index': 'Optional[slice]'}
__doc__ = 'Catalyst VAE for suzuki reactions.'
__module__ = 'gt4sd.algorithms.controlled_sampling.advanced_manufacturing.implementation.nccr.core'
class CatalystBindingEnergyPredictor(resources_path, checkpoint_filename='epoch=199-step=5799.ckpt')[source]

Bases: PropertyPredictor

Catalyst binding energy predictor for suzuki reactions.

__init__(resources_path, checkpoint_filename='epoch=199-step=5799.ckpt')[source]

Constructs a CatalystBindingEnergyPredictor.

Parameters
  • resources_path (str) – directory where to find models and configurations.

  • checkpoint_filename (str) – checkpoint filename. Defaults to “epoch=199-step=5799.ckpt”.

model: MlpPredictor
__call__(z)[source]

Predict binding energy.

Parameters

z (Union[ndarray, Tensor, Series]) – a latent space point.

Return type

float

Returns

the predicted binding energy.

__annotations__ = {'input_representations': 'Optional[List[str]]', 'model': <class 'gt4sd.frameworks.granular.ml.models.mlp_predictor.core.MlpPredictor'>}
__doc__ = 'Catalyst binding energy predictor for suzuki reactions.'
__module__ = 'gt4sd.algorithms.controlled_sampling.advanced_manufacturing.implementation.nccr.core'
class CatalystGenerator(resources_path, generated_length=100, number_of_points=10, number_of_steps=50, primer_smiles='', checkpoint_filename='epoch=199-step=5799.ckpt')[source]

Bases: Generator

Catalyst generator.

__init__(resources_path, generated_length=100, number_of_points=10, number_of_steps=50, primer_smiles='', checkpoint_filename='epoch=199-step=5799.ckpt')[source]

Constructs catalyst generator.

Parameters
  • resource_path – directory where to find models and configurations.

  • generated_length (int) – maximum lenght of the generated molecule. Defaults to 100.

  • number_of_points (int) – number of optimal points to return. Defaults to 10.

  • number_of_steps (int) – number of optimization steps. Defaults to 50.

  • primer_smiles (str) – primer SMILES representation. Default to “”, a.k.a., no primer.

  • checkpoint_filename (str) – checkpoint filename. Defaults to “epoch=199-step=5799.ckpt”.

__annotations__ = {}
__doc__ = 'Catalyst generator.'
__module__ = 'gt4sd.algorithms.controlled_sampling.advanced_manufacturing.implementation.nccr.core'
generate_samples(target_energy)[source]

Generate samples given a target energy.

Parameters

target_energy (Union[float, str]) – target energy value.

Return type

List[str]

Returns

catalysts sampled for the target value.