class_docstr: Neural Network class.
  
  Parameters
  ----------
  layers : list
      Layers of the Neural Network.
  
  Examples
  --------
  Create a NeuralNetwork from the given layers.
  
  >>> from madmom.ml.nn.layers import FeedForwardLayer
  >>> from madmom.ml.nn.activations import tanh, sigmoid
  >>> l1_weights = np.array([[0.5, -1., -0.3 , -0.2]])
  >>> l1_bias = np.array([0.05, 0., 0.8, -0.5])
  >>> l1 = FeedForwardLayer(l1_weights, l1_bias, activation_fn=tanh)
  >>> l2_weights = np.array([-1, 0.9, -0.2 , 0.4])
  >>> l2_bias = np.array([0.5])
  >>> l2 = FeedForwardLayer(l2_weights, l2_bias, activation_fn=sigmoid)
  >>> nn = NeuralNetwork([l1, l2])
  >>> nn  # doctest: +ELLIPSIS
  <madmom.ml.nn.NeuralNetwork object at 0x...>
  >>> nn(np.array([[0], [0.5], [1], [0], [1], [2], [0]]))
  ... # doctest: +NORMALIZE_WHITESPACE
  array([0.53305, 0.36903, 0.265 , 0.53305, 0.265 , 0.18612, 0.53305])
docstr: Process the given data with the neural network.
  
  Parameters
  ----------
  data : numpy array, shape (num_frames, num_inputs)
      Activate the network with this data.
  reset : bool, optional
      Reset the network to its initial state before activating it.
  
  Returns
  -------
  numpy array, shape (num_frames, num_outputs)
      Network predictions for this data.
docstr_tok: ["Process","the","given","data","with","the","neural","network",".","Parameters","--","--","--","--","--","data",":","numpy","array",",","shape","(","num_frames",",","num_inputs",")","Activate","the","network","with","this","data",".","reset",":","bool",",","optional","Reset","the","network","to","its","initial","state","before","activating","it",".","Returns","--","--","--","-","numpy","array",",","shape","(","num_frames",",","num_outputs",")","Network","predictions","for","this","data","."]
code: def process(self, data, reset=True, **kwargs):
      """
      Process the given data with the neural network.
  
      Parameters
      ----------
      data : numpy array, shape (num_frames, num_inputs)
          Activate the network with this data.
      reset : bool, optional
          Reset the network to its initial state before activating it.
  
      Returns
      -------
      numpy array, shape (num_frames, num_outputs)
          Network predictions for this data.
  
      """
      # make data at least 2d (required by NN-layers)
      if isinstance(data, np.ndarray) and data.ndim < 2:
          data = np.array(data, subok=True, copy=False, ndmin=2)
      # loop over all layers
      for layer in self.layers:
          # activate the layer and feed the output into the next one
          data = layer(data, reset=reset)
      # squeeze predictions to contain only true dimensions
      try:
          return data.squeeze()
      except AttributeError:
          # multi-task networks have multiple outputs and return lists
          return tuple([d.squeeze() for d in data])
  
file_path: madmom/madmom/ml/nn/__init__.py
imports: from __future__ import absolute_import, division, print_function
  import numpy
  from ...processors import Processor, ParallelProcessor, SequentialProcessor
label_desc: Use image node_id 2 for calling the NeuralNetwork obj's underlying member method code with example usage: obj.process(data, reset) and returns: data, tuple