Skip to content
Back to skills

Integrated Gradient Computation

ASecurity

Compute Integrated Gradients with Riemann-summed path gradients and completeness diagnostics for attribution recovery.

  • 247 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 9, 2026
toolspython

Security analysis

A100/100

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill integrated_gradient_computation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Integrated Gradient Computation?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Integrated Gradient Computation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-integrated-gradient-computation/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-integrated-gradient-computation)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
---
name: integrated_gradient_computation
description: Compute Integrated Gradients with Riemann-summed path gradients and completeness diagnostics for attribution recovery.
---

# Integrated Gradient Computation

Use this skill to compute feature attributions from a differentiable scalar function or from an injected gradient callable. Do not use plain input gradients as a substitute for Integrated Gradients when the function may be saturated at the input.

## Inputs
- `gradient_fn(point)`: returns one gradient value per feature.
- `input_vector` and `baseline_vector`: equal-length numeric vectors.
- `steps`: Riemann approximation count, typically 20 to 300 for real models.
- Optional `output_fn` for completeness diagnostics.

## Outputs
- `attributions`: one attribution per input feature.
- `attribution_sum`: sum of feature attributions.
- Optional `output_difference` and `completeness_error`.

## Workflow
1. Generate the straight-line path from baseline to input.
2. Evaluate gradients at each interpolation point.
3. Average gradients per feature.
4. Multiply averaged gradients by the input-baseline feature deltas.
5. If an output function is provided, compare the attribution sum to `F(x)-F(baseline)`.

## Validation
Run `python tests/test_integrated_gradients.py` or the Distiller skill-tree validator with tests enabled.

## Limitations
The script expects deterministic Python callables. Framework-specific autograd wrappers should adapt their tensors to this callable interface.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…