class_docstr: Multilayer Perceptron for binary and multi-class classification.
  
  Attributes:
    output_dim: Integer representing the number of classes.
    hidden_sizes: List containing the sizes of the hidden layers.
    activation: An activation function to apply to the output of each hidden
      layer.
    aggregation: String representing an aggregation operation that could be
      applied to the inputs. Valid options: None, `add`. If None, then no
      aggregation is performed. If `add`, the first half of the features
      dimension is added to the second half (see the `_aggregate` function
      for details).
    hidden_aggregation: A tuple or list of integers representing the number of
      hidden units in each layer of the projection network described above.
    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: ["Multilayer","Perceptron","for","binary","and","multi-class","classification",".","Attributes",":","output_dim",":","Integer","representing","the","number","of","classes",".","hidden_sizes",":","List","containing","the","sizes","of","the","hidden","layers",".","activation",":","An","activation","function","to","apply","to","the","output","of","each","hidden","layer",".","aggregation",":","String","representing","an","aggregation","operation","that","could","be","applied","to","the","inputs",".","Valid","options",":","None",",","`","add","`",".","If","None",",","then","no","aggregation","is","performed",".","If","`","add","`",",","the","first","half","of","the","features","dimension","is","added","to","the","second","half","(","see","the","`","_aggregate","`","function","for","details",")",".","hidden_aggregation",":","A","tuple","or","list","of","integers","representing","the","number","of","hidden","units","in","each","layer","of","the","projection","network","described","above",".","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","."]
docstr: Creates the model hidden representations and prediction ops.
  
  For this model, the hidden representation is the last layer of the MLP,
  before the logit computation. The predictions are unnormalized logits.
  
  Args:
    inputs: A tensor containing the model inputs. The first dimension is the
      batch size.
    **unused_kwargs: Other unused keyword arguments.
  
  Returns:
    encoding: A tensor containing an encoded batch of samples. The first
      dimension corresponds to the batch size.
    all_vars: A dictionary mapping from variable name to TensorFlow op
      containing all variables used in this model.
    reg_params: A dictionary mapping from a variable name to a Tensor of
      parameters which will be used for regularization.
docstr_tok: ["Creates","the","model","hidden","representations","and","prediction","ops",".","For","this","model",",","the","hidden","representation","is","the","last","layer","of","the","MLP",",","before","the","logit","computation",".","The","predictions","are","unnormalized","logits",".","Args",":","inputs",":","A","tensor","containing","the","model","inputs",".","The","first","dimension","is","the","batch","size",".","*","*","unused_kwargs",":","Other","unused","keyword","arguments",".","Returns",":","encoding",":","A","tensor","containing","an","encoded","batch","of","samples",".","The","first","dimension","corresponds","to","the","batch","size",".","all_vars",":","A","dictionary","mapping","from","variable","name","to","TensorFlow","op","containing","all","variables","used","in","this","model",".","reg_params",":","A","dictionary","mapping","from","a","variable","name","to","a","Tensor","of","parameters","which","will","be","used","for","regularization","."]
code: def get_encoding_and_params(self, inputs, **unused_kwargs):
      """Creates the model hidden representations and prediction ops.
  
      For this model, the hidden representation is the last layer of the MLP,
      before the logit computation. The predictions are unnormalized logits.
  
      Args:
        inputs: A tensor containing the model inputs. The first dimension is the
          batch size.
        **unused_kwargs: Other unused keyword arguments.
  
      Returns:
        encoding: A tensor containing an encoded batch of samples. The first
          dimension corresponds to the batch size.
        all_vars: A dictionary mapping from variable name to TensorFlow op
          containing all variables used in this model.
        reg_params: A dictionary mapping from a variable name to a Tensor of
          parameters which will be used for regularization.
      """
      # Build layers.
      with tf.variable_scope(self.name):
          if isinstance(inputs, (tuple, list)):
              with tf.variable_scope("encoding"):
                  hidden1, reg_params = self._construct_layers(
                      inputs[0]
                  )
              with tf.variable_scope("encoding", reuse=True):
                  hidden2, _ = self._construct_layers(inputs[1])
              hidden = self._aggregate((hidden1, hidden2))
          else:
              with tf.variable_scope("encoding"):
                  hidden, reg_params = self._construct_layers(inputs)
  
          # Store model variables for easy access.
          variables = tf.get_collection(
              tf.GraphKeys.GLOBAL_VARIABLES,
              scope=tf.get_default_graph().get_name_scope(),
          )
          all_vars = {var.name: var for var in variables}
  
      return hidden, all_vars, reg_params
  
file_path: neural-structured-learning/research/gam/gam/models/mlp.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from .models_base import glorot
  from .models_base import Model
  import numpy
  import tensorflow
label_desc: Use image node_id 3 for calling the MLP obj's underlying member method code with example usage: obj.get_encoding_and_params(inputs) and returns: hidden,  all_vars,  reg_params