Skip to content

v1.0.0

Latest

Choose a tag to compare

@github-actions github-actions released this 22 Sep 21:35

ExplainableAI v1.0.0

Diff since v0.10.3

Breaking changes

  • BREAKING Update XAIBase interface to v5. Analyzers now return an Attribution instead of an Explanation, which drops the analyzer and heatmap fields in favor of a pooling that reduces attributions over their feature dimension and determines the heatmapping preset. Refer to the XAIBase.jl changelog for more information (#200)
  • BREAKING Gradient and SmoothGrad return attributions with NormPooling, InputTimesGradient and IntegratedGradients with SumPooling, and GradCAM with UnsignedNoPooling. This changes the default heatmap of IntegratedGradients: since it satisfies completeness, its attributions are now summed over color channels and shown in a diverging colormap (#200)
  • BREAKING NoiseAugmentation and InterpolationAugmentation require a pooling keyword argument, e.g. NoiseAugmentation(Gradient(model), 50; pooling = NormPooling()), instead of propagating the heatmapping style of the wrapped analyzer (#200)
  • BREAKINGBugfix Fix NoiseAugmentation and SmoothGrad misinterpreting a real-valued std argument: the noise distribution was built as Normal(0, std^2), but Distributions.Normal takes the standard deviation, so noise was sampled with standard deviation std^2 instead of std. This changes results for std ≠ 1 (#199)
  • BREAKINGBugfix Fix IntegratedGradients and InterpolationAugmentation mutating the reference input. The interpolation was accumulated in place on input_ref, which overwrote a user-provided input_ref and corrupted the final multiplication with input - input_ref: attributions had the wrong sign and shrank roughly like 1/n. This changes IntegratedGradients results (#199)
  • BREAKINGBugfix Fix the quadrature of IntegratedGradients and InterpolationAugmentation. The path integral is now computed with the trapezoidal rule on exactly n points spanning the reference and the input (inclusive), instead of averaging n+1 points overshooting past the input. This changes IntegratedGradients results (#199)
  • BREAKINGEnhancement SmoothGrad and IntegratedGradients are now dedicated analyzers that hold the model, the AD backend and their sampling parameters directly, instead of wrapping a Gradient analyzer in a NoiseAugmentation or InterpolationAugmentation. They own an efficient implementation that selects the output once, reuses a DifferentiationInterface.jl preparation and a gradient buffer across all samples, and computes a single forward pass per sample on all AD backends. NoiseAugmentation and InterpolationAugmentation stay generic wrappers around arbitrary analyzers (#199)
  • BREAKING AD backends are forwarded to DifferentiationInterface.jl unmodified. Analyzers on the DifferentiationInterface.jl fallback (SmoothGrad, IntegratedGradients, and all analyzers on backends without a package extension) differentiate a stateless masking function and pass the model as a constant context, so an AutoEnzyme backend carrying a function_annotation for the model now errors on these analyzers. The Enzyme extension used by Gradient and InputTimesGradient in reverse mode still applies the annotation to the model (#199)

Other changes

  • Bugfix Gradient-based analyzers now compute a single forward pass instead of two when using the default Zygote backend. A package extension on Zygote selects the output between the forward and the reverse pass of Zygote.pullback (#186, #199)
  • Bugfix Gradient-based analyzers now compute a single forward pass instead of two when using Enzyme in reverse mode. A package extension on Enzyme selects the output between the forward and the reverse pass of Enzyme's split mode (#186, #199)
  • Bugfix Gradient now returns attributions of the array type of the input on all AD backends. Forward-mode Enzyme previously returned an immutable Enzyme.TupleArray (#199)
  • Feature SmoothGrad and IntegratedGradients now support AD backend selection via the keyword argument backend, e.g. SmoothGrad(model; backend=AutoEnzyme()) (#197)
  • Feature Add backend accessor, returning the AD backend of a gradient-based analyzer (#197)
  • Maintenance Switch from JuliaFormatter to Runic, update JET (#188)
  • Maintenance Standardize linting, import hygiene and CI workflows (#196)

Merged pull requests:

Closed issues:

  • Bug: Gradient-based analyzers compute two forward passes instead of one (#186)