class_docstr: Implementation of methods in Neural Cleanse: Identifying and Mitigating Backdoor Attacks in Neural Networks.
  Wang et al. (2019).
  
  | Paper link: https://people.cs.uchicago.edu/~ravenben/publications/pdf/backdoor-sp19.pdf
docstr: Compute the gradient of the loss function w.r.t. `x`.
  
  :param x: Sample input with shape as expected by the model.
  :param y: Target values (class labels) one-hot-encoded of shape (nb_samples, nb_classes) or indices of shape
            (nb_samples,).
  :param training_mode: `True` for model set to training mode and `'False` for model set to evaluation mode.
  :return: Array of gradients of the same shape as `x`.
docstr_tok: ["Compute","the","gradient","of","the","loss","function","w.r.t",".","`","x","`",".",":","param","x",":","Sample","input","with","shape","as","expected","by","the","model",".",":","param","y",":","Target","values","(","class","labels",")","one-hot-encoded","of","shape","(","nb_samples",",","nb_classes",")","or","indices","of","shape","(","nb_samples",",",")",".",":","param","training_mode",":","`","True","`","for","model","set","to","training","mode","and","`","'False","`","for","model","set","to","evaluation","mode",".",":","return",":","Array","of","gradients","of","the","same","shape","as","`","x","`","."]
code: def loss_gradient(
      self,
      x: np.ndarray,
      y: np.ndarray,
      training_mode: bool = False,
      **kwargs,
  ) -> np.ndarray:
      """
      Compute the gradient of the loss function w.r.t. `x`.
  
      :param x: Sample input with shape as expected by the model.
      :param y: Target values (class labels) one-hot-encoded of shape (nb_samples, nb_classes) or indices of shape
                (nb_samples,).
      :param training_mode: `True` for model set to training mode and `'False` for model set to evaluation mode.
      :return: Array of gradients of the same shape as `x`.
      """
      return self.loss_gradient(
          x=x, y=y, training_mode=training_mode, **kwargs
      )
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  from typing import List, Optional, Tuple, Union, TYPE_CHECKING
  import numpy
  from tqdm.auto import tqdm
  from art.config import ART_NUMPY_DTYPE
  from art.estimators.poison_mitigation.neural_cleanse.neural_cleanse import NeuralCleanseMixin
  from art.estimators.classification.keras import KerasClassifier, KERAS_MODEL_TYPE
label_desc: Use image node_id 11 for calling the KerasNeuralCleanse obj's underlying member method code with example usage: obj.loss_gradient(x, y, training_mode) and returns: self