class_docstr: Base class of model to provide attack.
  
  Args:
      bounds(tuple): The lower and upper bound for the image pixel.
      channel_axis(int): The index of the axis that represents the color
              channel.
      preprocess(tuple): Two element tuple used to preprocess the input.
          First substract the first element, then divide the second element.
class_docstr_tok: ["Base","class","of","model","to","provide","attack",".","Args",":","bounds","(","tuple",")",":","The","lower","and","upper","bound","for","the","image","pixel",".","channel_axis","(","int",")",":","The","index","of","the","axis","that","represents","the","color","channel",".","preprocess","(","tuple",")",":","Two","element","tuple","used","to","preprocess","the","input",".","First","substract","the","first","element",",","then","divide","the","second","element","."]
docstr: Calculate the gradient of the cross-entropy loss w.r.t the image.
  
  Args:
      data(numpy.ndarray): input data with shape (size, height, width,
      channels).
      label(int): Label used to calculate the gradient.
  
  Return:
      numpy.ndarray: gradient of the cross-entropy loss w.r.t the image
          with the shape (height, width, channel).
docstr_tok: ["Calculate","the","gradient","of","the","cross-entropy","loss","w.r.t","the","image",".","Args",":","data","(","numpy.ndarray",")",":","input","data","with","shape","(","size",",","height",",","width",",","channels",")",".","label","(","int",")",":","Label","used","to","calculate","the","gradient",".","Return",":","numpy.ndarray",":","gradient","of","the","cross-entropy","loss","w.r.t","the","image","with","the","shape","(","height",",","width",",","channel",")","."]
code: def gradient(self, data, label):
      """
      Calculate the gradient of the cross-entropy loss w.r.t the image.
  
      Args:
          data(numpy.ndarray): input data with shape (size, height, width,
          channels).
          label(int): Label used to calculate the gradient.
  
      Return:
          numpy.ndarray: gradient of the cross-entropy loss w.r.t the image
              with the shape (height, width, channel).
      """
      raise NotImplementedError
  
file_path: AdvBox/adversarialbox/models/base.py
imports: from __future__ import division
  from builtins import object
  from past.utils import old_div
  from abc import ABCMeta
  from abc import abstractmethod
  import numpy
  from future.utils import with_metaclass
label_desc: Use image node_id 7 for calling the Model obj's underlying member method code with example usage: obj.gradient(data, label) without return types