class_docstr: Convolutional Neural Network for image classification.
  
  It assumes the inputs are images of shape width x height x channels.
  The precise architecture follows the Tensorflow CNN
  tutorial at https://www.tensorflow.org/tutorials/images/deep_cnn.
  Note that this CNN works both for the agreement and classification models.
  In the agreement case, the provided inputs will be a tuple
  (inputs_src, inputs_target), which are aggregated into one input after the
  convolution layers, right before the fully connected network that makes the
  final prediction.
  
  Attributes:
    output_dim: Integer representing the number of classes.
    channels: Integer representing the number of channels in the input images
      (e.g., 1 for black and white, 3 for RGB).
    aggregation: String representing an aggregation operation, that is applied
      on the two inputs of the agreement model, after they are encoded through
      the convolution layers. See superclass attributes for details.
    activation: An activation function to be applied to the outputs of each
      fully connected layer of the aggregation network.
    is_binary_classification: Boolean specifying if this is model for
      binary classification. If so, it uses a different loss function and
      returns predictions with a single dimension, batch size.
    name: String representing the model name.
class_docstr_tok: ["Convolutional","Neural","Network","for","image","classification",".","It","assumes","the","inputs","are","images","of","shape","width","x","height","x","channels",".","The","precise","architecture","follows","the","Tensorflow","CNN","tutorial","at","https",":","\/\/www.tensorflow.org\/tutorials\/images\/deep_cnn",".","Note","that","this","CNN","works","both","for","the","agreement","and","classification","models",".","In","the","agreement","case",",","the","provided","inputs","will","be","a","tuple","(","inputs_src",",","inputs_target",")",",","which","are","aggregated","into","one","input","after","the","convolution","layers",",","right","before","the","fully","connected","network","that","makes","the","final","prediction",".","Attributes",":","output_dim",":","Integer","representing","the","number","of","classes",".","channels",":","Integer","representing","the","number","of","channels","in","the","input","images","(","e.g.",",","1","for","black","and","white",",","3","for","RGB",")",".","aggregation",":","String","representing","an","aggregation","operation",",","that","is","applied","on","the","two","inputs","of","the","agreement","model",",","after","they","are","encoded","through","the","convolution","layers",".","See","superclass","attributes","for","details",".","activation",":","An","activation","function","to","be","applied","to","the","outputs","of","each","fully","connected","layer","of","the","aggregation","network",".","is_binary_classification",":","Boolean","specifying","if","this","is","model","for","binary","classification",".","If","so",",","it","uses","a","different","loss","function","and","returns","predictions","with","a","single","dimension",",","batch","size",".","name",":","String","representing","the","model","name","."]
code: def __init__(
      self,
      output_dim,
      channels,
      aggregation=None,
      hidden_aggregation=(),
      activation=tf.nn.leaky_relu,
      is_binary_classification=False,
      name="cnn_agr",
  ):
      super(ImageCNNAgreement, self).__init__(
          aggregation=aggregation,
          hidden_aggregation=hidden_aggregation,
          activation=activation,
      )
      self.output_dim = output_dim
      self.channels = channels
      self.is_binary_classification = is_binary_classification
      self.name = name
  
file_path: neural-structured-learning/research/gam/gam/models/cnn.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from .models_base import Model
  import tensorflow
label_desc: Use image node_id 1 to create a new ImageCNNAgreement object from inherited base classes: Model with example: obj = ImageCNNAgreement(output_dim, channels, aggregation, hidden_aggregation, activation, is_binary_classification, name)