class_docstr: lasagne.layers.NINLayer(incoming, num_units, untie_biases=False,
  W=lasagne.init.GlorotUniform(), b=lasagne.init.Constant(0.),
  nonlinearity=lasagne.nonlinearities.rectify, **kwargs)
  
  Network-in-network layer.
  Like DenseLayer, but broadcasting across all trailing dimensions beyond the
  2nd.  This results in a convolution operation with filter size 1 on all
  trailing dimensions.  Any number of trailing dimensions is supported,
  so NINLayer can be used to implement 1D, 2D, 3D, ... convolutions.
  
  Parameters
  ----------
  incoming : a :class:`Layer` instance or a tuple
      The layer feeding into this layer, or the expected input shape
  
  num_units : int
      The number of units of the layer
  
  untie_biases : bool
      If false the network has a single bias vector similar to a dense
      layer. If true a separate bias vector is used for each trailing
      dimension beyond the 2nd.
  
  W : Theano shared variable, expression, numpy array or callable
      Initial value, expression or initializer for the weights.
      These should be a matrix with shape ``(num_inputs, num_units)``,
      where ``num_inputs`` is the size of the second dimension of the input.
      See :func:`lasagne.utils.create_param` for more information.
  
  b : Theano shared variable, expression, numpy array, callable or ``None``
      Initial value, expression or initializer for the biases. If set to
      ``None``, the layer will have no biases. Otherwise, biases should be
      a 1D array with shape ``(num_units,)`` for ``untie_biases=False``, and
      a tensor of shape ``(num_units, input_shape[2], ..., input_shape[-1])``
      for ``untie_biases=True``.
      See :func:`lasagne.utils.create_param` for more information.
  
  nonlinearity : callable or None
      The nonlinearity that is applied to the layer activations. If None
      is provided, the layer will be linear.
  
  Examples
  --------
  >>> from lasagne.layers import InputLayer, NINLayer
  >>> l_in = InputLayer((100, 20, 10, 3))
  >>> l1 = NINLayer(l_in, num_units=5)
  
  References
  ----------
  .. [1] Lin, Min, Qiang Chen, and Shuicheng Yan (2013):
         Network in network. arXiv preprint arXiv:1312.4400.
class_docstr_tok: ["lasagne.layers.NINLayer","(","incoming",",","num_units",",","untie_biases=False",",","W=lasagne.init.GlorotUniform","(",")",",","b=lasagne.init.Constant","(","0",".",")",",","nonlinearity=lasagne.nonlinearities.rectify",",","*","*","kwargs",")","Network-in-network","layer",".","Like","DenseLayer",",","but","broadcasting","across","all","trailing","dimensions","beyond","the","2nd",".","This","results","in","a","convolution","operation","with","filter","size","1","on","all","trailing","dimensions",".","Any","number","of","trailing","dimensions","is","supported",",","so","NINLayer","can","be","used","to","implement","1D",",","2D",",","3D",",","...","convolutions",".","Parameters","--","--","--","--","--","incoming",":","a",":","class",":","`","Layer","`","instance","or","a","tuple","The","layer","feeding","into","this","layer",",","or","the","expected","input","shape","num_units",":","int","The","number","of","units","of","the","layer","untie_biases",":","bool","If","false","the","network","has","a","single","bias","vector","similar","to","a","dense","layer",".","If","true","a","separate","bias","vector","is","used","for","each","trailing","dimension","beyond","the","2nd",".","W",":","Theano","shared","variable",",","expression",",","numpy","array","or","callable","Initial","value",",","expression","or","initializer","for","the","weights",".","These","should","be","a","matrix","with","shape","``","(","num_inputs",",","num_units",")","``",",","where","``","num_inputs","``","is","the","size","of","the","second","dimension","of","the","input",".","See",":","func",":","`","lasagne.utils.create_param","`","for","more","information",".","b",":","Theano","shared","variable",",","expression",",","numpy","array",",","callable","or","``","None","``","Initial","value",",","expression","or","initializer","for","the","biases",".","If","set","to","``","None","``",",","the","layer","will","have","no","biases",".","Otherwise",",","biases","should","be","a","1D","array","with","shape","``","(","num_units",",",")","``","for","``","untie_biases=False","``",",","and","a","tensor","of","shape","``","(","num_units",",","input_shape","[","2","]",",","...",",","input_shape","[","-1","]",")","``","for","``","untie_biases=True","``",".","See",":","func",":","`","lasagne.utils.create_param","`","for","more","information",".","nonlinearity",":","callable","or","None","The","nonlinearity","that","is","applied","to","the","layer","activations",".","If","None","is","provided",",","the","layer","will","be","linear",".","Examples","--","--","--","--",">",">",">","from","lasagne.layers","import","InputLayer",",","NINLayer",">",">",">","l_in","=","InputLayer","(","(","100",",","20",",","10",",","3",")",")",">",">",">","l1","=","NINLayer","(","l_in",",","num_units=5",")","References","--","--","--","--","--","..","[","1","]","Lin",",","Min",",","Qiang","Chen",",","and","Shuicheng","Yan","(","2013",")",":","Network","in","network",".","arXiv","preprint","arXiv:1312.4400","."]
code: def get_output_for(self, input, **kwargs):
      # cf * bc01... = fb01...
      out_r = T.tensordot(self.W, input, axes=[[0], [1]])
      # input dims to broadcast over
      remaining_dims = range(2, input.ndim)
      # bf01...
      out = out_r.dimshuffle(1, 0, *remaining_dims)
  
      if self.b is None:
          activation = out
      else:
          if self.untie_biases:
              # no broadcast
              remaining_dims_biases = range(1, input.ndim - 1)
          else:
              remaining_dims_biases = ["x"] * (
                  input.ndim - 2
              )  # broadcast
          b_shuffled = self.b.dimshuffle("x", 0, *remaining_dims_biases)
          activation = out + b_shuffled
  
      return self.nonlinearity(activation)
  
file_path: Lasagne/lasagne/layers/dense.py
imports: import numpy
  import theano.tensor
  from ..None import init
  from ..None import nonlinearities
  from .base import Layer
label_desc: Use image node_id 3 for calling the NINLayer obj's underlying member method code with example usage: obj.get_output_for(input) and returns: self