class_docstr: Generator class for BasicMolGAN model.
  Using subclassing rather than functional API due to requirement
  to swap between two outputs depending on situation.
  In order to get output that used for sample generation
  (conversion to rdkit molecules) pass sample_generation=True argument while
  calling the model i.e. adjacency_matrix, nodes_features = self.generators[0](
  noise_input, training=False, sample_generation=True)
  This is automatically done in predict_gan_generator().
class_docstr_tok: ["Generator","class","for","BasicMolGAN","model",".","Using","subclassing","rather","than","functional","API","due","to","requirement","to","swap","between","two","outputs","depending","on","situation",".","In","order","to","get","output","that","used","for","sample","generation","(","conversion","to","rdkit","molecules",")","pass","sample_generation=True","argument","while","calling","the","model","i.e",".","adjacency_matrix",",","nodes_features","=","self.generators","[","0","]","(","noise_input",",","training=False",",","sample_generation=True",")","This","is","automatically","done","in","predict_gan_generator","(",")","."]
docstr: Initialize model.
  
  Parameters
  ----------
  vertices : int, optional
      number of max atoms dataset molecules (incl. empty atom), by default 9
  edges : int, optional
      number of bond types in molecules, by default 5
  nodes : int, optional
      number of atom types in molecules, by default 5
  dropout_rate : float, optional
      rate of dropout, by default 0.
  embedding_dim : int, optional
      noise input dimensions, by default 10
  name : str, optional
      name of the model, by default "SimpleMolGANGenerator"
docstr_tok: ["Initialize","model",".","Parameters","--","--","--","--","--","vertices",":","int",",","optional","number","of","max","atoms","dataset","molecules","(","incl",".","empty","atom",")",",","by","default","9","edges",":","int",",","optional","number","of","bond","types","in","molecules",",","by","default","5","nodes",":","int",",","optional","number","of","atom","types","in","molecules",",","by","default","5","dropout_rate",":","float",",","optional","rate","of","dropout",",","by","default","0.","embedding_dim",":","int",",","optional","noise","input","dimensions",",","by","default","10","name",":","str",",","optional","name","of","the","model",",","by","default","``","SimpleMolGANGenerator","''"]
code: def __init__(
      self,
      vertices: int = 9,
      edges: int = 5,
      nodes: int = 5,
      dropout_rate: float = 0.0,
      embedding_dim: int = 10,
      name: str = "SimpleMolGANGenerator",
      **kwargs,
  ):
      """
      Initialize model.
  
      Parameters
      ----------
      vertices : int, optional
          number of max atoms dataset molecules (incl. empty atom), by default 9
      edges : int, optional
          number of bond types in molecules, by default 5
      nodes : int, optional
          number of atom types in molecules, by default 5
      dropout_rate : float, optional
          rate of dropout, by default 0.
      embedding_dim : int, optional
          noise input dimensions, by default 10
      name : str, optional
          name of the model, by default "SimpleMolGANGenerator"
      """
      super(BasicMolGANGenerator, self).__init__(name=name, **kwargs)
      self.vertices = vertices
      self.edges = edges
      self.nodes = nodes
      self.dropout_rate = dropout_rate
      self.embedding_dim = embedding_dim
  
      self.dense1 = layers.Dense(
          128, activation="tanh", input_shape=(self.embedding_dim,)
      )
      self.dropout1 = layers.Dropout(self.dropout_rate)
      self.dense2 = layers.Dense(256, activation="tanh")
      self.dropout2 = layers.Dropout(self.dropout_rate)
      self.dense3 = layers.Dense(512, activation="tanh")
      self.dropout3 = layers.Dropout(self.dropout_rate)
  
      # edges logits used during training
      self.edges_dense = layers.Dense(
          units=self.edges * self.vertices * self.vertices,
          activation=None,
      )
      self.edges_reshape = layers.Reshape(
          (self.edges, self.vertices, self.vertices)
      )
      self.edges_matrix_transpose1 = layers.Permute((1, 3, 2))
      self.edges_matrix_transpose2 = layers.Permute((2, 3, 1))
      self.edges_dropout = layers.Dropout(self.dropout_rate)
  
      # nodes logits used during training
      self.nodes_dense = layers.Dense(
          units=(self.vertices * self.nodes), activation=None
      )
      self.nodes_reshape = layers.Reshape((self.vertices, self.nodes))
      self.nodes_dropout = layers.Dropout(self.dropout_rate)
  
file_path: deepchem/deepchem/models/molgan.py
imports: from typing import Optional, List, Tuple, Any
  import tensorflow
  from deepchem.feat.molecule_featurizers.molgan_featurizer import GraphMatrix
  from deepchem.models import WGAN
  from deepchem.models.layers import MolGANEncoderLayer
  from tensorflow import keras
  from tensorflow.keras import layers
label_desc: Use image node_id 1 to create a new BasicMolGANGenerator object from inherited base classes: tf.keras with example: obj = BasicMolGANGenerator(vertices, edges, nodes, dropout_rate, embedding_dim, name)