class_docstr: The :class:`~poutyne.ModelBundle` class provides a straightforward experimentation tool for efficient and entirely
  customizable finetuning of the whole neural network training procedure with PyTorch. The
  :class:`~poutyne.ModelBundle` object takes care of the training and testing processes while also managing to keep
  traces of all pertinent information via the automatic logging option.
  
  Use ``ModelBundle.from_*`` methods to instanciate a :class:`~poutyne.ModelBundle`.
class_docstr_tok: ["The",":","class",":","`","~poutyne.ModelBundle","`","class","provides","a","straightforward","experimentation","tool","for","efficient","and","entirely","customizable","finetuning","of","the","whole","neural","network","training","procedure","with","PyTorch",".","The",":","class",":","`","~poutyne.ModelBundle","`","object","takes","care","of","the","training","and","testing","processes","while","also","managing","to","keep","traces","of","all","pertinent","information","via","the","automatic","logging","option",".","Use","``","ModelBundle.from_","*","``","methods","to","instanciate","a",":","class",":","`","~poutyne.ModelBundle","`","."]
docstr: Returns the predictions of the network given batches of samples ``x``, where the tensors are
  converted into Numpy arrays.
  
  Args:
      generator: Generator-like object for the dataset. The generator must yield a batch of
          samples. See the :func:`fit_generator()` method for details on the types of generators
          supported. This should only yield input data ``x`` and NOT the target ``y``.
      checkpoint (Union[str, int]): Which model checkpoint weights to load for the prediction.
  
          - If 'best', will load the best weights according to ``monitor_metric`` and ``monitor_mode``.
          - If 'last', will load the last model checkpoint.
          - If int, will load the checkpoint of the specified epoch.
          - If a path (str), will load the model pickled state_dict weights (for instance, saved as
            ``torch.save(a_pytorch_network.state_dict(), "./a_path.p")``).
  
          This argument has no effect when logging is disabled. (Default value = 'best')
      kwargs: Any keyword arguments to pass to :func:`~Model.predict_generator()`.
  
  Returns:
      Depends on the value of ``concatenate_returns``. By default, (``concatenate_returns`` is true),
      the data structures (tensor, tuple, list, dict) returned as predictions for the batches are
      merged together. In the merge, the tensors are converted into Numpy arrays and are then
      concatenated together. If ``concatenate_returns`` is false, then a list of the predictions
      for the batches is returned with tensors converted into Numpy arrays.
docstr_tok: ["Returns","the","predictions","of","the","network","given","batches","of","samples","``","x","``",",","where","the","tensors","are","converted","into","Numpy","arrays",".","Args",":","generator",":","Generator-like","object","for","the","dataset",".","The","generator","must","yield","a","batch","of","samples",".","See","the",":","func",":","`","fit_generator","(",")","`","method","for","details","on","the","types","of","generators","supported",".","This","should","only","yield","input","data","``","x","``","and","NOT","the","target","``","y","``",".","checkpoint","(","Union","[","str",",","int","]",")",":","Which","model","checkpoint","weights","to","load","for","the","prediction",".","-","If","'best","'",",","will","load","the","best","weights","according","to","``","monitor_metric","``","and","``","monitor_mode","``",".","-","If","'last","'",",","will","load","the","last","model","checkpoint",".","-","If","int",",","will","load","the","checkpoint","of","the","specified","epoch",".","-","If","a","path","(","str",")",",","will","load","the","model","pickled","state_dict","weights","(","for","instance",",","saved","as","``","torch.save","(","a_pytorch_network.state_dict","(",")",",","``",".\/a_path.p","''",")","``",")",".","This","argument","has","no","effect","when","logging","is","disabled",".","(","Default","value","=","'best","'",")","kwargs",":","Any","keyword","arguments","to","pass","to",":","func",":","`","~Model.predict_generator","(",")","`",".","Returns",":","Depends","on","the","value","of","``","concatenate_returns","``",".","By","default",",","(","``","concatenate_returns","``","is","true",")",",","the","data","structures","(","tensor",",","tuple",",","list",",","dict",")","returned","as","predictions","for","the","batches","are","merged","together",".","In","the","merge",",","the","tensors","are","converted","into","Numpy","arrays","and","are","then","concatenated","together",".","If","``","concatenate_returns","``","is","false",",","then","a","list","of","the","predictions","for","the","batches","is","returned","with","tensors","converted","into","Numpy","arrays","."]
code: def infer(self, generator, **kwargs) -> Any:
      """
      Returns the predictions of the network given batches of samples ``x``, where the tensors are
      converted into Numpy arrays.
  
      Args:
          generator: Generator-like object for the dataset. The generator must yield a batch of
              samples. See the :func:`fit_generator()` method for details on the types of generators
              supported. This should only yield input data ``x`` and NOT the target ``y``.
          checkpoint (Union[str, int]): Which model checkpoint weights to load for the prediction.
  
              - If 'best', will load the best weights according to ``monitor_metric`` and ``monitor_mode``.
              - If 'last', will load the last model checkpoint.
              - If int, will load the checkpoint of the specified epoch.
              - If a path (str), will load the model pickled state_dict weights (for instance, saved as
                ``torch.save(a_pytorch_network.state_dict(), "./a_path.p")``).
  
              This argument has no effect when logging is disabled. (Default value = 'best')
          kwargs: Any keyword arguments to pass to :func:`~Model.predict_generator()`.
  
      Returns:
          Depends on the value of ``concatenate_returns``. By default, (``concatenate_returns`` is true),
          the data structures (tensor, tuple, list, dict) returned as predictions for the batches are
          merged together. In the merge, the tensors are converted into Numpy arrays and are then
          concatenated together. If ``concatenate_returns`` is false, then a list of the predictions
          for the batches is returned with tensors converted into Numpy arrays.
      """
      return self._predict(
          self.model.predict_generator, generator, **kwargs
      )
  
imports: import os
  import warnings
  from typing import Any, Callable, Dict, List, Tuple, Union
  import torch
  from poutyne.framework.callbacks import AtomicCSVLogger, BestModelRestore, LRSchedulerCheckpoint, ModelCheckpoint, OptimizerCheckpoint, PeriodicSaveLambda, RandomStatesCheckpoint, TensorBoardLogger
  from poutyne.framework.model import Model
  from poutyne.plotting import plot_history
  from poutyne.utils import load_random_states, set_seeds
label_desc: Use image node_id 33 for calling the ModelBundle obj's underlying member method code with example usage: obj.infer(generator) and returns: self