QSAR Gan

This script is used to train a Generative Adversarial Network (GAN) model for generating molecules. It uses the DeepChem and TensorFlow libraries for the GAN model and the QsarGanFeaturizer for featurizing the molecules. The QsarGan class is responsible for the training and prediction process.

class qsar.gan.qsar_gan.QsarGan(learning_rate: ExponentialDecay, featurizer: QsarGanFeaturizer, edges: int = 5, nodes: int = 5, embedding_dim: int = 10, dropout_rate: float = 0.0, **kwargs)

Bases: object

A class that trains a Generative Adversarial Network (GAN) model for generating SMILES of synthetic molecules.

fit_predict(features: ndarray, epochs=32, generator_steps=0.2, checkpoint_interval=5000, number_to_generate=10000) list

Trains the GAN model and generates new molecules.

Parameters:
  • features (np.ndarray) – the features used for training the GAN model

  • epochs (int, optional) – the number of epochs for training the GAN model, defaults to 32

  • generator_steps (float, optional) – the number of generator steps in the GAN model, defaults to 0.2

  • checkpoint_interval (int, optional) – the interval for saving checkpoints in the GAN model, defaults to 5000

  • number_to_generate (int, optional) – the number of molecules to generate, defaults to 10000

Returns:

a list of unique SMILES strings representing the generated molecules

Return type:

list