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: Call generator model
  
  Parameters
  ----------
  inputs : Any
      List of inputs, typically noise_batch
  training : bool, optional
      used by dropout layers, by default False
  sample_generation : bool, optional
      decide which output to use, by default False
  
  Returns
  -------
  List[Any, Any]
      Tensors containing either softmax values for training
      or argmax for sample generation (used for creation of rdkit molecules).
docstr_tok: ["Call","generator","model","Parameters","--","--","--","--","--","inputs",":","Any","List","of","inputs",",","typically","noise_batch","training",":","bool",",","optional","used","by","dropout","layers",",","by","default","False","sample_generation",":","bool",",","optional","decide","which","output","to","use",",","by","default","False","Returns","--","--","--","-","List","[","Any",",","Any","]","Tensors","containing","either","softmax","values","for","training","or","argmax","for","sample","generation","(","used","for","creation","of","rdkit","molecules",")","."]
code: def call(
      self,
      inputs: Any,
      training: bool = False,
      sample_generation: bool = False,
  ) -> List[Any]:
      """
      Call generator model
  
      Parameters
      ----------
      inputs : Any
          List of inputs, typically noise_batch
      training : bool, optional
          used by dropout layers, by default False
      sample_generation : bool, optional
          decide which output to use, by default False
  
      Returns
      -------
      List[Any, Any]
          Tensors containing either softmax values for training
          or argmax for sample generation (used for creation of rdkit molecules).
      """
  
      x = self.dense1(inputs)
      x = self.dropout1(x)
      x = self.dense2(x)
      x = self.dropout2(x)
      x = self.dense3(x)
      x = self.dropout3(x)
  
      # edges logits
      edges_logits = self.edges_dense(x)
      edges_logits = self.edges_reshape(edges_logits)
      matrix_transpose = self.edges_matrix_transpose1(edges_logits)
      edges_logits = (edges_logits + matrix_transpose) / 2
      edges_logits = self.edges_matrix_transpose2(edges_logits)
      edges_logits = self.edges_dropout(edges_logits)
  
      # nodes logits
      nodes_logits = self.nodes_dense(x)
      nodes_logits = self.nodes_reshape(nodes_logits)
      nodes_logits = self.nodes_dropout(nodes_logits)
  
      if sample_generation is False:
          # training of the model
          edges = tf.nn.softmax(edges_logits)
          nodes = tf.nn.softmax(nodes_logits)
      else:
          # generating compounds
          e_gumbel_logits = edges_logits - tf.math.log(
              -tf.math.log(
                  tf.random.uniform(
                      tf.shape(edges_logits), dtype=edges_logits.dtype
                  )
              )
          )
          e_gumbel_argmax = tf.one_hot(
              tf.argmax(e_gumbel_logits, axis=-1),
              depth=e_gumbel_logits.shape[-1],
              dtype=e_gumbel_logits.dtype,
          )
          edges = tf.argmax(e_gumbel_argmax, axis=-1)
  
          # nodes logits used during compound generation
          n_gumbel_logits = nodes_logits - tf.math.log(
              -tf.math.log(
                  tf.random.uniform(
                      tf.shape(nodes_logits), dtype=nodes_logits.dtype
                  )
              )
          )
          n_gumbel_argmax = tf.one_hot(
              tf.argmax(n_gumbel_logits, axis=-1),
              depth=n_gumbel_logits.shape[-1],
              dtype=n_gumbel_logits.dtype,
          )
          nodes = tf.argmax(n_gumbel_argmax, axis=-1)
  
      return [edges, nodes]
  
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 2 for calling the BasicMolGANGenerator obj's underlying member method code with example usage: obj.call(inputs, training, sample_generation) and returns: list