class_docstr: Create a PaddleModel instance.
  When you need to generate a adversarial sample, you should construct an
  instance of PaddleModel.
  Args:
      program(paddle.fluid.framework.Program): The program of the model
          which generate the adversarial sample.
      input_name(string): The name of the input.
      logits_name(string): The name of the logits.
      predict_name(string): The name of the predict.
      cost_name(string): The name of the loss in the program.
class_docstr_tok: ["Create","a","PaddleModel","instance",".","When","you","need","to","generate","a","adversarial","sample",",","you","should","construct","an","instance","of","PaddleModel",".","Args",":","program","(","paddle.fluid.framework.Program",")",":","The","program","of","the","model","which","generate","the","adversarial","sample",".","input_name","(","string",")",":","The","name","of","the","input",".","logits_name","(","string",")",":","The","name","of","the","logits",".","predict_name","(","string",")",":","The","name","of","the","predict",".","cost_name","(","string",")",":","The","name","of","the","loss","in","the","program","."]
docstr: Calculate the prediction of the data.
  Args:
      data(numpy.ndarray): input data with shape (size,
      height, width, channels).
  Return:
      numpy.ndarray: predictions of the data with shape (batch_size,
          num_of_classes).
docstr_tok: ["Calculate","the","prediction","of","the","data",".","Args",":","data","(","numpy.ndarray",")",":","input","data","with","shape","(","size",",","height",",","width",",","channels",")",".","Return",":","numpy.ndarray",":","predictions","of","the","data","with","shape","(","batch_size",",","num_of_classes",")","."]
code: def predict(self, data):
      """
      Calculate the prediction of the data.
      Args:
          data(numpy.ndarray): input data with shape (size,
          height, width, channels).
      Return:
          numpy.ndarray: predictions of the data with shape (batch_size,
              num_of_classes).
      """
      scaled_data = self._process_input(data)
      feeder = fluid.DataFeeder(
          feed_list=[self._input_name, self._logits_name],
          place=self._place,
          program=self._predict_program,
      )
      predict_var = self._predict_program.block(0).var(
          self._predict_name
      )
      predict = self._exe.run(
          self._predict_program,
          feed=feeder.feed([(scaled_data, 0)]),
          fetch_list=[predict_var],
      )
      predict = np.squeeze(predict, axis=0)
      return predict
  
file_path: AdvBox/adversarialbox/models/paddleBlackBox.py
imports: from __future__ import absolute_import
  import numpy
  import os
  import paddle.fluid
  from .base import Model
label_desc: Use image node_id 2 for calling the PaddleBlackBoxModel obj's underlying member method code with example usage: obj.predict(data) and returns: predict