class_docstr: Multi-Layer Perceptron Class
  
  A multilayer perceptron is a feedforward artificial neural network model
  that has one layer or more of hidden units and nonlinear activations.
  Intermidiate layers usually have as activation function thanh or the
  sigmoid function (defined here by a ``SigmoidalLayer`` class)  while the
  top layer is a softamx layer (defined here by a ``LogisticRegression``
  class).
class_docstr_tok: ["Multi-Layer","Perceptron","Class","A","multilayer","perceptron","is","a","feedforward","artificial","neural","network","model","that","has","one","layer","or","more","of","hidden","units","and","nonlinear","activations",".","Intermidiate","layers","usually","have","as","activation","function","thanh","or","the","sigmoid","function","(","defined","here","by","a","``","SigmoidalLayer","``","class",")","while","the","top","layer","is","a","softamx","layer","(","defined","here","by","a","``","LogisticRegression","``","class",")","."]
docstr: Initialize the parameters for the multilayer perceptron
  
  :type rng: numpy.random.RandomState
  :param rng: a random number generator used to initialize weights
  
  :type input: theano.tensor.TensorType
  :param input: symbolic variable that describes the input of the
  architecture (one minibatch)
  
  :type n_in: int
  :param n_in: number of input units, the dimension of the space in
  which the datapoints lie
  
  :type n_hidden: int
  :param n_hidden: number of hidden units
  
  :type n_out: int
  :param n_out: number of output units, the dimension of the space in
  which the labels lie
docstr_tok: ["Initialize","the","parameters","for","the","multilayer","perceptron",":","type","rng",":","numpy.random.RandomState",":","param","rng",":","a","random","number","generator","used","to","initialize","weights",":","type","input",":","theano.tensor.TensorType",":","param","input",":","symbolic","variable","that","describes","the","input","of","the","architecture","(","one","minibatch",")",":","type","n_in",":","int",":","param","n_in",":","number","of","input","units",",","the","dimension","of","the","space","in","which","the","datapoints","lie",":","type","n_hidden",":","int",":","param","n_hidden",":","number","of","hidden","units",":","type","n_out",":","int",":","param","n_out",":","number","of","output","units",",","the","dimension","of","the","space","in","which","the","labels","lie"]
code: def __init__(self, rng, input, n_in, n_hidden, n_out):
      """Initialize the parameters for the multilayer perceptron
  
      :type rng: numpy.random.RandomState
      :param rng: a random number generator used to initialize weights
  
      :type input: theano.tensor.TensorType
      :param input: symbolic variable that describes the input of the
      architecture (one minibatch)
  
      :type n_in: int
      :param n_in: number of input units, the dimension of the space in
      which the datapoints lie
  
      :type n_hidden: int
      :param n_hidden: number of hidden units
  
      :type n_out: int
      :param n_out: number of output units, the dimension of the space in
      which the labels lie
  
      """
  
      # Since we are dealing with a one hidden layer MLP, this will
      # translate into a TanhLayer connected to the LogisticRegression
      # layer; this can be replaced by a SigmoidalLayer, or a layer
      # implementing any other nonlinearity
      self.hiddenLayer = HiddenLayer(
          rng=rng,
          input=input,
          n_in=n_in,
          n_out=n_hidden,
          activation=T.tanh,
          name_prefix="hid_",
      )
  
      # The logistic regression layer gets as input the hidden units
      # of the hidden layer
      self.logRegressionLayer = LogisticRegression(
          input=self.hiddenLayer.output,
          n_in=n_hidden,
          n_out=n_out,
          name_prefix="log_",
      )
  
      # negative log likelihood of the MLP is given by the negative
      # log likelihood of the output of the model, computed in the
      # logistic regression layer
      self.negative_log_likelihood = (
          self.logRegressionLayer.negative_log_likelihood
      )
  
      # the parameters of the model are the parameters of the two layer it is
      # made out of
      self.params = (
          self.hiddenLayer.params + self.logRegressionLayer.params
      )
  
file_path: Theano/theano/tensor/tests/mlp_test.py
imports: from __future__ import absolute_import, print_function, division
  from collections import OrderedDict
  import numpy
  import theano
  import theano.tensor
label_desc: Use image node_id 1 to create a new MLP object from inherited base classes: object with example: obj = MLP(rng, input, n_in, n_hidden, n_out)