class_docstr: This class implements a DGM with the TensorFlow framework.
class_docstr_tok: ["This","class","implements","a","DGM","with","the","TensorFlow","framework","."]
docstr: Perform projections over a batch of encodings.
  
  :param x: Encodings.
  :param batch_size: Batch size.
  :param training_mode: `True` for model set to training mode and `'False` for model set to evaluation mode.
  :return: Array of prediction projections of shape `(num_inputs, nb_classes)`.
docstr_tok: ["Perform","projections","over","a","batch","of","encodings",".",":","param","x",":","Encodings",".",":","param","batch_size",":","Batch","size",".",":","param","training_mode",":","`","True","`","for","model","set","to","training","mode","and","`","'False","`","for","model","set","to","evaluation","mode",".",":","return",":","Array","of","prediction","projections","of","shape","`","(","num_inputs",",","nb_classes",")","`","."]
code: def predict(  # pylint: disable=W0221
      self,
      x: np.ndarray,
      batch_size: int = 128,
      training_mode: bool = False,
      **kwargs,
  ) -> np.ndarray:
      """
      Perform projections over a batch of encodings.
  
      :param x: Encodings.
      :param batch_size: Batch size.
      :param training_mode: `True` for model set to training mode and `'False` for model set to evaluation mode.
      :return: Array of prediction projections of shape `(num_inputs, nb_classes)`.
      """
      # Run prediction with batch processing
      results_list = []
      num_batch = int(np.ceil(len(x) / float(batch_size)))
      for m in range(num_batch):
          # Batch indexes
          begin, end = (
              m * batch_size,
              min((m + 1) * batch_size, x.shape[0]),
          )
  
          # Run prediction
          results_list.append(
              self._model(x[begin:end], training=training_mode).numpy()
          )
  
      results = np.vstack(results_list)
  
      return results
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from typing import Any, Dict, List, Optional, Union, Tuple, TYPE_CHECKING
  import numpy
  from art.estimators.generation.generator import GeneratorMixin
  from art.estimators.tensorflow import TensorFlowEstimator, TensorFlowV2Estimator
label_desc: Use image node_id 5 for calling the TensorFlowV2Generator obj's underlying member method code with example usage: obj.predict(x, batch_size, training_mode) and returns: results