class_docstr: Implementation of DeepZ to certify neural network robustness. We use the zonotope 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://papers.nips.cc/paper/2018/file/f2f446980d8e971ef3da97af089481c3-Paper.pdf
class_docstr_tok: ["Implementation","of","DeepZ","to","certify","neural","network","robustness",".","We","use","the","zonotope","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",":","\/\/papers.nips.cc\/paper\/2018\/file\/f2f446980d8e971ef3da97af089481c3-Paper.pdf"]
docstr: Check if the datapoint has been certifiably classified.
  
  First do the forward pass through the NN with the given error terms and zonotope center to
  obtain the output zonotope.
  
  Then perform the certification step by computing the difference of the logits in the final zonotope
  and projecting to interval.
  
  :param cent: The datapoint, representing the zonotope center.
  :param eps: Error terms of the zonotope.
  :param prediction: The prediction the neural network gave on the basic datapoint.
  
  :return: True/False if the datapoint could be misclassified given the eps bounds.
docstr_tok: ["Check","if","the","datapoint","has","been","certifiably","classified",".","First","do","the","forward","pass","through","the","NN","with","the","given","error","terms","and","zonotope","center","to","obtain","the","output","zonotope",".","Then","perform","the","certification","step","by","computing","the","difference","of","the","logits","in","the","final","zonotope","and","projecting","to","interval",".",":","param","cent",":","The","datapoint",",","representing","the","zonotope","center",".",":","param","eps",":","Error","terms","of","the","zonotope",".",":","param","prediction",":","The","prediction","the","neural","network","gave","on","the","basic","datapoint",".",":","return",":","True\/False","if","the","datapoint","could","be","misclassified","given","the","eps","bounds","."]
code: def certify(
      self, cent: np.ndarray, eps: np.ndarray, prediction: int
  ) -> bool:
      """
      Check if the datapoint has been certifiably classified.
  
      First do the forward pass through the NN with the given error terms and zonotope center to
      obtain the output zonotope.
  
      Then perform the certification step by computing the difference of the logits in the final zonotope
      and projecting to interval.
  
      :param cent: The datapoint, representing the zonotope center.
      :param eps: Error terms of the zonotope.
      :param prediction: The prediction the neural network gave on the basic datapoint.
  
      :return: True/False if the datapoint could be misclassified given the eps bounds.
      """
      cent_tensor, eps_tensor = self.model.forward(eps=eps, cent=cent)
      cent = cent_tensor.detach().cpu().numpy()
      eps = eps_tensor.detach().cpu().numpy()
  
      certification_results = []
      for k in range(self.nb_classes):
          if k != prediction:
              cert_via_sub = self.certify_via_subtraction(
                  predicted_class=prediction,
                  class_to_consider=k,
                  cent=cent,
                  eps=eps,
              )
              certification_results.append(cert_via_sub)
  
      return all(certification_results)
  
imports: from typing import List, Optional, Tuple, Union, Callable, Any, TYPE_CHECKING
  import logging
  import math
  import warnings
  import sys
  import numpy
  import torch
  from art.estimators.certification.deep_z.deep_z import ZonoConv, ZonoDenseLayer, ZonoReLU, ZonoBounds
  from art.estimators.classification.pytorch import PyTorchClassifier
label_desc: Use image node_id 3 for calling the PytorchDeepZ obj's underlying member method code with example usage: obj.certify(cent, eps, prediction) and returns: all