code: def __init__(
      self,
      module,
      input,
      label,
      logits,
      loss,
      bounds,
      channel_axis=3,
      preprocess=None,
      featurefqueezing_bit_depth=None,
  ):
      import keras.backend as k
  
      if preprocess is None:
          preprocess = (0, 1)
  
      super(KerasModel, self).__init__(
          bounds=bounds,
          channel_axis=channel_axis,
          preprocess=preprocess,
      )
  
      self._module = module
  
      self._loss = loss
  
      self._label = label
      self._logits = logits
      self._input = input
  
      _, self._nb_classes = k.int_shape(self._logits)
      self._input_shape = k.int_shape(self._input)[1:]
  
      logger.info("self._input_shape:" + str(self._input_shape))
  
      logger.info("init grads[{0}]...".format(self._nb_classes))
  
      # 定义预测函数
      preds = self._logits
      self._preds = k.function([self._input], [preds])
  
      self._featurefqueezing_bit_depth = featurefqueezing_bit_depth
  
      if self._featurefqueezing_bit_depth is not None:
          logging.info(
              "use featurefqueezing_bit_depth={}".format(
                  self._featurefqueezing_bit_depth
              )
          )
  
      logger.info("Finish KerasModel init")
  
file_path: AdvBox/adversarialbox/models/keras.py
imports: from __future__ import absolute_import
  from builtins import str
  import numpy
  import os
  import sys
  from .base import Model
  from adversarialbox.defences.feature_squeezing import FeatureFqueezingDefence
  import logging
label_desc: Use image node_id 1 to create a new KerasModel object from inherited base classes: Model with example: obj = KerasModel(module, input, label, logits, loss, bounds, channel_axis, preprocess, featurefqueezing_bit_depth)