docstr: Typical hidden layer of a MLP: units are fully-connected and have
  sigmoidal activation function. Weight matrix W is of shape (n_in,n_out)
  and the bias vector b is of shape (n_out,).
  
  NOTE : The nonlinearity used here is tanh
  
  Hidden unit activation is given by: tanh(dot(input,W) + b)
  
  :type rng: numpy.random.RandomState
  :param rng: a random number generator used to initialize weights
  
  :type input: theano.tensor.dmatrix
  :param input: a symbolic tensor of shape (n_examples, n_in)
  
  :type n_in: int
  :param n_in: dimensionality of input
  
  :type n_out: int
  :param n_out: number of hidden units
  
  :type activation: theano.Op or function
  :param activation: Non linearity to be applied in the hidden
                        layer
docstr_tok: ["Typical","hidden","layer","of","a","MLP",":","units","are","fully-connected","and","have","sigmoidal","activation","function",".","Weight","matrix","W","is","of","shape","(","n_in",",","n_out",")","and","the","bias","vector","b","is","of","shape","(","n_out",",",")",".","NOTE",":","The","nonlinearity","used","here","is","tanh","Hidden","unit","activation","is","given","by",":","tanh","(","dot","(","input",",","W",")","+","b",")",":","type","rng",":","numpy.random.RandomState",":","param","rng",":","a","random","number","generator","used","to","initialize","weights",":","type","input",":","theano.tensor.dmatrix",":","param","input",":","a","symbolic","tensor","of","shape","(","n_examples",",","n_in",")",":","type","n_in",":","int",":","param","n_in",":","dimensionality","of","input",":","type","n_out",":","int",":","param","n_out",":","number","of","hidden","units",":","type","activation",":","theano.Op","or","function",":","param","activation",":","Non","linearity","to","be","applied","in","the","hidden","layer"]
code: def __init__(
      self, rng, input, n_in, n_out, activation=T.tanh, name_prefix=""
  ):
      """
      Typical hidden layer of a MLP: units are fully-connected and have
      sigmoidal activation function. Weight matrix W is of shape (n_in,n_out)
      and the bias vector b is of shape (n_out,).
  
      NOTE : The nonlinearity used here is tanh
  
      Hidden unit activation is given by: tanh(dot(input,W) + b)
  
      :type rng: numpy.random.RandomState
      :param rng: a random number generator used to initialize weights
  
      :type input: theano.tensor.dmatrix
      :param input: a symbolic tensor of shape (n_examples, n_in)
  
      :type n_in: int
      :param n_in: dimensionality of input
  
      :type n_out: int
      :param n_out: number of hidden units
  
      :type activation: theano.Op or function
      :param activation: Non linearity to be applied in the hidden
                            layer
      """
      self.input = input
  
      # `W` is initialized with `W_values` which is uniformely sampled
      # from -6./sqrt(n_in+n_hidden) and 6./sqrt(n_in+n_hidden)
      # the output of uniform if converted using asarray to dtype
      # theano.config.floatX so that the code is runable on GPU
      W_values = np.asarray(
          rng.uniform(
              low=-np.sqrt(6.0 / (n_in + n_out)),
              high=np.sqrt(6.0 / (n_in + n_out)),
              size=(n_in, n_out),
          ),
          dtype=theano.config.floatX,
      )
      self.W = theano.shared(value=W_values, name=name_prefix + "W")
  
      self.output = T.dot(input, self.W)
      # parameters of the model
      self.params = [self.W]
  
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 HiddenLayer object from inherited base classes: object with example: obj = HiddenLayer(rng, input, n_in, n_out, activation, name_prefix)