class_docstr: Multi-class Logistic Regression Class
  
  The logistic regression is fully described by a weight matrix :math:`W`
  and bias vector :math:`b`. Classification is done by projecting data
  points onto a set of hyperplanes, the distance to which is used to
  determine a class membership probability.
class_docstr_tok: ["Multi-class","Logistic","Regression","Class","The","logistic","regression","is","fully","described","by","a","weight","matrix",":","math",":","`","W","`","and","bias","vector",":","math",":","`","b","`",".","Classification","is","done","by","projecting","data","points","onto","a","set","of","hyperplanes",",","the","distance","to","which","is","used","to","determine","a","class","membership","probability","."]
docstr: Return the mean of the negative log-likelihood of the prediction
  of this model under a given target distribution.
  
  .. math::
  
      \frac{1}{|\mathcal{D}|} \mathcal{L} (\theta=\{W,b\}, \mathcal{D}) =
      \frac{1}{|\mathcal{D}|} \sum_{i=0}^{|\mathcal{D}|} \log(P(Y=y^{(i)}|x^{(i)}, W,b)) \\
          \ell (\theta=\{W,b\}, \mathcal{D})
  
  :type y: theano.tensor.TensorType
  :param y: corresponds to a vector that gives for each example the
            correct label
  
  Note: we use the mean instead of the sum so that
        the learning rate is less dependent on the batch size
docstr_tok: ["Return","the","mean","of","the","negative","log-likelihood","of","the","prediction","of","this","model","under","a","given","target","distribution",".","..","math",":",":","\\frac","{","1","}","{","|\\mathcal","{","D","}","|","}","\\mathcal","{","L","}","(","\\theta=\\","{","W",",","b\\","}",",","\\mathcal","{","D","}",")","=","\\frac","{","1","}","{","|\\mathcal","{","D","}","|","}","\\sum_","{","i=0","}","^","{","|\\mathcal","{","D","}","|","}","\\log","(","P","(","Y=y^","{","(","i",")","}","|x^","{","(","i",")","}",",","W",",","b",")",")","\\\\","\\ell","(","\\theta=\\","{","W",",","b\\","}",",","\\mathcal","{","D","}",")",":","type","y",":","theano.tensor.TensorType",":","param","y",":","corresponds","to","a","vector","that","gives","for","each","example","the","correct","label","Note",":","we","use","the","mean","instead","of","the","sum","so","that","the","learning","rate","is","less","dependent","on","the","batch","size"]
code: def negative_log_likelihood(self, y):
      r"""Return the mean of the negative log-likelihood of the prediction
          of this model under a given target distribution.
  
          .. math::
  
              \frac{1}{|\mathcal{D}|} \mathcal{L} (\theta=\{W,b\}, \mathcal{D}) =
              \frac{1}{|\mathcal{D}|} \sum_{i=0}^{|\mathcal{D}|} \log(P(Y=y^{(i)}|x^{(i)}, W,b)) \\
                  \ell (\theta=\{W,b\}, \mathcal{D})
  
          :type y: theano.tensor.TensorType
          :param y: corresponds to a vector that gives for each example the
                    correct label
  
          Note: we use the mean instead of the sum so that
                the learning rate is less dependent on the batch size
          """
      # y.shape[0] is (symbolically) the number of rows in y, i.e., number of examples (call it n) in the minibatch
      # T.arange(y.shape[0]) is a symbolic vector which will contain [0,1,2,... n-1]
      # T.log(self.p_y_given_x) is a matrix of Log-Probabilities (call it LP) with one row per example and one column per class
      # LP[T.arange(y.shape[0]),y] is a vector v containing [LP[0,y[0]], LP[1,y[1]], LP[2,y[2]], ..., LP[n-1,y[n-1]]]
      # and T.mean(LP[T.arange(y.shape[0]),y]) is the mean (across minibatch examples) of the elements in v,
      # i.e., the mean log-likelihood across the minibatch.
      return T.log(self.p_y_given_x[T.arange(y.shape[0]), y])
  
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 2 for calling the LogisticRegression obj's underlying member method code with example usage: obj.negative_log_likelihood(y) and returns: T