class_docstr: Implementation of Interval based certification for neural network robustness.
  We use the interval (also called box) representation of a datapoint as it travels through the network
  to then verify if it can have its class changed given a certain perturbation.
  
  | Paper link: https://ieeexplore.ieee.org/document/8418593
  
  This classifier has 3 modes which can be set via: classifier.model.set_forward_mode('mode')
  
  'mode' can be one of:
      + 'abstract': When we wish to certifiy datapoints and have abstract predictions
      + 'concrete': When normal predictions need to be made
      + 'attack': When we are interfacing with an ART attack (for example PGD).
docstr: Produce interval predictions over the supplied data
  
  :param x: The datapoint, either:
  
          1. In the interval format of x[batch_size, 2, feature_1, feature_2, ...]
             where axis=1 corresponds to the [lower, upper] bounds.
  
          2. Or in regular concrete form, in which case the bounds/limits need to be supplied.
  :param is_interval: if the datapoint is already in the correct interval format.
  :param bounds: The perturbation range.
  :param limits: The clipping to apply to the interval data.
  :param batch_size: batch size to use when looping through the data
  :param training_mode: `True` for model set to training mode and `'False` for model set to evaluation mode.
  :param kwargs: Dictionary of framework-specific arguments. This parameter is not currently supported for PyTorch
         and providing it takes no effect.
  :return: interval predictions over the supplied dataset
docstr_tok: ["Produce","interval","predictions","over","the","supplied","data",":","param","x",":","The","datapoint",",","either",":","1",".","In","the","interval","format","of","x","[","batch_size",",","2",",","feature_1",",","feature_2",",","...","]","where","axis=1","corresponds","to","the","[","lower",",","upper","]","bounds",".","2",".","Or","in","regular","concrete","form",",","in","which","case","the","bounds\/limits","need","to","be","supplied",".",":","param","is_interval",":","if","the","datapoint","is","already","in","the","correct","interval","format",".",":","param","bounds",":","The","perturbation","range",".",":","param","limits",":","The","clipping","to","apply","to","the","interval","data",".",":","param","batch_size",":","batch","size","to","use","when","looping","through","the","data",":","param","training_mode",":","`","True","`","for","model","set","to","training","mode","and","`","'False","`","for","model","set","to","evaluation","mode",".",":","param","kwargs",":","Dictionary","of","framework-specific","arguments",".","This","parameter","is","not","currently","supported","for","PyTorch","and","providing","it","takes","no","effect",".",":","return",":","interval","predictions","over","the","supplied","dataset"]
code: def predict_intervals(  # pylint: disable=W0613
      self,
      x: np.ndarray,
      is_interval: bool = False,
      bounds: Optional[Union[float, List[float], np.ndarray]] = None,
      limits: Optional[Union[List[float], np.ndarray]] = None,
      batch_size: int = 128,
      training_mode: bool = False,
      **kwargs,
  ) -> np.ndarray:
      """
      Produce interval predictions over the supplied data
  
      :param x: The datapoint, either:
  
              1. In the interval format of x[batch_size, 2, feature_1, feature_2, ...]
                 where axis=1 corresponds to the [lower, upper] bounds.
  
              2. Or in regular concrete form, in which case the bounds/limits need to be supplied.
      :param is_interval: if the datapoint is already in the correct interval format.
      :param bounds: The perturbation range.
      :param limits: The clipping to apply to the interval data.
      :param batch_size: batch size to use when looping through the data
      :param training_mode: `True` for model set to training mode and `'False` for model set to evaluation mode.
      :param kwargs: Dictionary of framework-specific arguments. This parameter is not currently supported for PyTorch
             and providing it takes no effect.
      :return: interval predictions over the supplied dataset
      """
  
      if len(x) < batch_size:
          batch_size = len(x)
  
      x_preprocessed, _ = self._apply_preprocessing(
          x, y=None, fit=False
      )
      self._model.train(mode=training_mode)
  
      if is_interval:
          x_interval = x_preprocessed
      elif bounds is None:
          raise ValueError(
              "If x is not provided as an interval please provide bounds (and optionally limits)"
          )
      else:
          if self.provided_concrete_to_interval is None:
              x_interval = self.concrete_to_interval(
                  x=x_preprocessed, bounds=bounds, limits=limits
              )
          else:
              x_interval = self.provided_concrete_to_interval(
                  x_preprocessed, bounds, limits
              )
  
      num_batches = int(len(x_interval) / batch_size)
  
      interval_predictions = []
  
      for bnum in range(num_batches):
          x_batch_interval = x_interval[
              batch_size * bnum : batch_size * (bnum + 1)
          ]
          abstract_preds = self.model.forward(x_batch_interval)
          interval_predictions.append(abstract_preds)
  
      if len(x_interval) % batch_size > 0:
          x_batch_interval = x_interval[batch_size * num_batches :]
          abstract_preds = self.model.forward(x_batch_interval)
          interval_predictions.append(abstract_preds)
  
      return (
          torch.concat(interval_predictions, dim=0)
          .cpu()
          .detach()
          .numpy()
      )
  
imports: from typing import List, Optional, Tuple, Union, Callable, Any, TYPE_CHECKING
  import logging
  import warnings
  import numpy
  import torch
  from art.estimators.certification.interval.interval import PyTorchIntervalConv2D, PyTorchIntervalDense, PyTorchIntervalReLU, PyTorchIntervalBounds
  from art.estimators.classification.pytorch import PyTorchClassifier
label_desc: Use image node_id 2 for calling the PyTorchIBPClassifier obj's underlying member method code with example usage: obj.predict_intervals(x, is_interval, bounds, limits, batch_size, training_mode) and returns: torch