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: Computes the loss as the largest logit value amongst the incorrect classes.
  
  :param prediction: model predictions.
  :param target: target classes. NB not one hot.
  :return: scalar loss value
docstr_tok: ["Computes","the","loss","as","the","largest","logit","value","amongst","the","incorrect","classes",".",":","param","prediction",":","model","predictions",".",":","param","target",":","target","classes",".","NB","not","one","hot",".",":","return",":","scalar","loss","value"]
code: def max_logit_loss(
      self, prediction: "torch.Tensor", target: "torch.Tensor"
  ) -> Union["torch.Tensor", None]:
      """
      Computes the loss as the largest logit value amongst the incorrect classes.
  
      :param prediction: model predictions.
      :param target: target classes. NB not one hot.
      :return: scalar loss value
      """
      target_logit = prediction[:, target]
      output = prediction - target_logit
  
      ubs = torch.sum(torch.abs(output[1:, :]), dim=0) + output[0, :]
  
      loss = None
      for i in range(self.nb_classes):
          if i != target and (loss is None or ubs[i] > loss):
              loss = ubs[i]
      return loss
  
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 6 for calling the PytorchDeepZ obj's underlying member method code with example usage: obj.max_logit_loss(prediction, target) and returns: loss