class_docstr: To run: "python -m unittest saliency.core.guided_ig_test" from the top-level directory.
docstr: Tests attributions of the quadratic function with dependent partials.
  
  The test sets such parameters that produce attribution equal to
  Integrated Gradients, namely, by setting zero deviation from the
  straight-line path or changing all features at every integration step.
docstr_tok: ["Tests","attributions","of","the","quadratic","function","with","dependent","partials",".","The","test","sets","such","parameters","that","produce","attribution","equal","to","Integrated","Gradients",",","namely",",","by","setting","zero","deviation","from","the","straight-line","path","or","changing","all","features","at","every","integration","step","."]
code: def testDependentQuadraticIG(self):
      """Tests attributions of the quadratic function with dependent partials.
  
      The test sets such parameters that produce attribution equal to
      Integrated Gradients, namely, by setting zero deviation from the
      straight-line path or changing all features at every integration step.
      """
      gig = guided_ig.GuidedIG()
      # Setting max_dist to 0.0 reduces Guided IG to regular IG.
      mask = gig.GetMask(
          x_value=[3, 3],
          call_model_function=self._quadratic_dep_test_func,
          x_steps=1000,
          fraction=0.1,
          max_dist=0.0,
      )
      np.testing.assert_allclose(mask, [54.0, 27.0], rtol=0.01)
  
      # Setting fraction to 1.0 also reduces Guided IG to regular IG.
      mask = gig.GetMask(
          x_value=[3, 3],
          call_model_function=self._quadratic_dep_test_func,
          x_steps=1000,
          fraction=1.0,
          max_dist=0.5,
      )
      np.testing.assert_allclose(mask, [54.0, 27.0], rtol=0.01)
  
file_path: saliency/saliency/core/guided_ig_test.py
imports: import unittest
  from .None import guided_ig
  from .base import INPUT_OUTPUT_GRADIENTS
  import numpy
label_desc: Use image node_id 8 for calling the GuidedIGTest obj's underlying member method code with example usage: obj.testDependentQuadraticIG() without return types