class_docstr: Neural Network ensemble class.
  
  Parameters
  ----------
  networks : list
      List of the Neural Networks.
  ensemble_fn : function or callable, optional
      Ensemble function to be applied to the predictions of the neural
      network ensemble (default: average predictions).
  num_threads : int, optional
      Number of parallel working threads.
  
  Notes
  -----
  If `ensemble_fn` is set to 'None', the predictions are returned as a list
  with the same length as the number of networks given.
  
  Examples
  --------
  Create a NeuralNetworkEnsemble from the networks. Instead of supplying
  the neural networks as parameter, they can also be loaded from file:
  
  >>> from madmom.models import ONSETS_BRNN_PP
  >>> nn = NeuralNetworkEnsemble.load(ONSETS_BRNN_PP)
  >>> nn  # doctest: +ELLIPSIS
  <madmom.ml.nn.NeuralNetworkEnsemble object at 0x...>
  >>> nn(np.array([[0], [0.5], [1], [0], [1], [2], [0]]))
  ... # doctest: +NORMALIZE_WHITESPACE
  array([0.00116, 0.00213, 0.01428, 0.00729, 0.0088 , 0.21965, 0.00532])
docstr: Add neural network options to an existing parser.
  
  Parameters
  ----------
  parser : argparse parser instance
      Existing argparse parser object.
  nn_files : list
      Neural network model files.
  
  Returns
  -------
  argparse argument group
      Neural network argument parser group.
docstr_tok: ["Add","neural","network","options","to","an","existing","parser",".","Parameters","--","--","--","--","--","parser",":","argparse","parser","instance","Existing","argparse","parser","object",".","nn_files",":","list","Neural","network","model","files",".","Returns","--","--","--","-","argparse","argument","group","Neural","network","argument","parser","group","."]
code: def add_arguments(parser, nn_files):
      """
      Add neural network options to an existing parser.
  
      Parameters
      ----------
      parser : argparse parser instance
          Existing argparse parser object.
      nn_files : list
          Neural network model files.
  
      Returns
      -------
      argparse argument group
          Neural network argument parser group.
  
      """
      # pylint: disable=signature-differs
      from madmom.utils import OverrideDefaultListAction
  
      # add neural network options
      g = parser.add_argument_group("neural network arguments")
      g.add_argument(
          "--nn_files",
          action=OverrideDefaultListAction,
          type=str,
          default=nn_files,
          help="average the predictions of these pre-trained "
          "neural networks (multiple files can be given, "
          "one file per argument)",
      )
      # return the argument group so it can be modified if needed
      return g
  
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 3 for calling the NeuralNetworkEnsemble obj's underlying member method code with example usage: obj.add_arguments(parser, nn_files) and returns: g