class_docstr: Implements the ChemCeption model that leverages the representational capacities
  of convolutional neural networks (CNNs) to predict molecular properties.
  
  The model is based on the description in Goh et al., "Chemception: A Deep
  Neural Network with Minimal Chemistry Knowledge Matches the Performance of
  Expert-developed QSAR/QSPR Models" (https://arxiv.org/pdf/1706.06689.pdf).
  The authors use an image based representation of the molecule, where pixels
  encode different atomic and bond properties. More details on the image repres-
  entations can be found at https://arxiv.org/abs/1710.02238
  
  The model consists of a Stem Layer that reduces the image resolution for the
  layers to follow. The output of the Stem Layer is followed by a series of
  Inception-Resnet blocks & a Reduction layer. Layers in the Inception-Resnet
  blocks process image tensors at multiple resolutions and use a ResNet style
  skip-connection, combining features from different resolutions. The Reduction
  layers reduce the spatial extent of the image by max-pooling and 2-strided
  convolutions. More details on these layers can be found in the ChemCeption
  paper referenced above. The output of the final Reduction layer is subject to
  a Global Average Pooling, and a fully-connected layer maps the features to
  downstream outputs.
  
  In the ChemCeption paper, the authors perform real-time image augmentation by
  rotating images between 0 to 180 degrees. This can be done during model
  training by setting the augment argument to True.
class_docstr_tok: ["Implements","the","ChemCeption","model","that","leverages","the","representational","capacities","of","convolutional","neural","networks","(","CNNs",")","to","predict","molecular","properties",".","The","model","is","based","on","the","description","in","Goh","et","al.",",","``","Chemception",":","A","Deep","Neural","Network","with","Minimal","Chemistry","Knowledge","Matches","the","Performance","of","Expert-developed","QSAR\/QSPR","Models","''","(","https",":","\/\/arxiv.org\/pdf\/1706.06689.pdf",")",".","The","authors","use","an","image","based","representation","of","the","molecule",",","where","pixels","encode","different","atomic","and","bond","properties",".","More","details","on","the","image","repres-","entations","can","be","found","at","https",":","\/\/arxiv.org\/abs\/1710.02238","The","model","consists","of","a","Stem","Layer","that","reduces","the","image","resolution","for","the","layers","to","follow",".","The","output","of","the","Stem","Layer","is","followed","by","a","series","of","Inception-Resnet","blocks","&","a","Reduction","layer",".","Layers","in","the","Inception-Resnet","blocks","process","image","tensors","at","multiple","resolutions","and","use","a","ResNet","style","skip-connection",",","combining","features","from","different","resolutions",".","The","Reduction","layers","reduce","the","spatial","extent","of","the","image","by","max-pooling","and","2-strided","convolutions",".","More","details","on","these","layers","can","be","found","in","the","ChemCeption","paper","referenced","above",".","The","output","of","the","final","Reduction","layer","is","subject","to","a","Global","Average","Pooling",",","and","a","fully-connected","layer","maps","the","features","to","downstream","outputs",".","In","the","ChemCeption","paper",",","the","authors","perform","real-time","image","augmentation","by","rotating","images","between","0","to","180","degrees",".","This","can","be","done","during","model","training","by","setting","the","augment","argument","to","True","."]
code: def _build_graph(self):
      smile_images = Input(shape=self.input_shape)
      stem = chemnet_layers.Stem(self.base_filters)(smile_images)
  
      inceptionA_out = self.build_inception_module(
          inputs=stem, type="A"
      )
      reductionA_out = chemnet_layers.ReductionA(self.base_filters)(
          inceptionA_out
      )
  
      inceptionB_out = self.build_inception_module(
          inputs=reductionA_out, type="B"
      )
      reductionB_out = chemnet_layers.ReductionB(self.base_filters)(
          inceptionB_out
      )
  
      inceptionC_out = self.build_inception_module(
          inputs=reductionB_out, type="C"
      )
      avg_pooling_out = GlobalAveragePooling2D()(inceptionC_out)
  
      if self.mode == "classification":
          logits = Dense(self.n_tasks * self.n_classes)(avg_pooling_out)
          logits = Reshape((self.n_tasks, self.n_classes))(logits)
          if self.n_classes == 2:
              output = Activation(activation="sigmoid")(logits)
              loss = SigmoidCrossEntropy()
          else:
              output = Softmax()(logits)
              loss = SoftmaxCrossEntropy()
          outputs = [output, logits]
          output_types = ["prediction", "loss"]
  
      else:
          output = Dense(self.n_tasks * 1)(avg_pooling_out)
          output = Reshape((self.n_tasks, 1))(output)
          outputs = [output]
          output_types = ["prediction"]
          loss = L2Loss()
  
      model = tf.keras.Model(inputs=[smile_images], outputs=outputs)
      return model, loss, output_types
  
imports: import numpy
  import tensorflow
  from typing import Dict
  from deepchem.data.datasets import pad_batch
  from deepchem.models import KerasModel
  from deepchem.models.losses import L2Loss, SoftmaxCrossEntropy, SigmoidCrossEntropy
  from deepchem.metrics import to_one_hot
  from deepchem.models import chemnet_layers
  from tensorflow.keras.layers import Input, Dense, Reshape, Softmax, Activation
  from tensorflow.keras.layers import Conv1D, GRU, LSTM, Bidirectional
  from tensorflow.keras.layers import GlobalAveragePooling2D
label_desc: Use image node_id 2 for calling the ChemCeption obj's underlying member method code with example usage: obj._build_graph() and returns: model,  loss,  output_types