Repository navigation
ExplainableAI v1.0.0
Breaking changes
Update XAIBase interface to
v5. Analyzers now return anAttributioninstead of anExplanation, which drops theanalyzerandheatmapfields in favor of apoolingthat reduces attributions over their feature dimension and determines the heatmapping preset. Refer to the XAIBase.jl changelog for more information (#200)GradientandSmoothGradreturn attributions withNormPooling,InputTimesGradientandIntegratedGradientswithSumPooling, andGradCAMwithUnsignedNoPooling. This changes the default heatmap ofIntegratedGradients: since it satisfies completeness, its attributions are now summed over color channels and shown in a diverging colormap (#200)NoiseAugmentationandInterpolationAugmentationrequire apoolingkeyword argument, e.g.NoiseAugmentation(Gradient(model), 50; pooling = NormPooling()), instead of propagating the heatmapping style of the wrapped analyzer (#200)Fix
NoiseAugmentationandSmoothGradmisinterpreting a real-valuedstdargument: the noise distribution was built asNormal(0, std^2), butDistributions.Normaltakes the standard deviation, so noise was sampled with standard deviationstd^2instead ofstd. This changes results forstd ≠ 1(#199)Fix
IntegratedGradientsandInterpolationAugmentationmutating the reference input. The interpolation was accumulated in place oninput_ref, which overwrote a user-providedinput_refand corrupted the final multiplication withinput - input_ref: attributions had the wrong sign and shrank roughly like1/n. This changesIntegratedGradientsresults (#199)Fix the quadrature of
IntegratedGradientsandInterpolationAugmentation. The path integral is now computed with the trapezoidal rule on exactlynpoints spanning the reference and the input (inclusive), instead of averagingn+1points overshooting past the input. This changesIntegratedGradientsresults (#199)SmoothGradandIntegratedGradientsare now dedicated analyzers that hold the model, the AD backend and their sampling parameters directly, instead of wrapping aGradientanalyzer in aNoiseAugmentationorInterpolationAugmentation. 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.NoiseAugmentationandInterpolationAugmentationstay generic wrappers around arbitrary analyzers (#199)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 anAutoEnzymebackend carrying afunction_annotationfor the model now errors on these analyzers. The Enzyme extension used byGradientandInputTimesGradientin reverse mode still applies the annotation to the model (#199)
Other changes
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)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)
Gradientnow returns attributions of the array type of the input on all AD backends. Forward-mode Enzyme previously returned an immutableEnzyme.TupleArray(#199)SmoothGradandIntegratedGradientsnow support AD backend selection via the keyword argumentbackend, e.g.SmoothGrad(model; backend=AutoEnzyme())(#197)Add
backendaccessor, returning the AD backend of a gradient-based analyzer (#197)Switch from JuliaFormatter to Runic, update JET (#188)
Standardize linting, import hygiene and CI workflows (#196)
Merged pull requests:
- Bump actions/checkout from 4 to 5 (#185) (@dependabot[bot])
- Bump actions/checkout from 5 to 6 (#187) (@dependabot[bot])
- Switch from JuliaFormatter to Runic, update JET (#188) (@adrhill)
- Bump actions/checkout from 5 to 6 (#189) (@dependabot[bot])
- Bump julia-actions/cache from 2 to 3 (#190) (@dependabot[bot])
- Bump codecov/codecov-action from 5 to 6 (#191) (@dependabot[bot])
- Bump julia-actions/setup-julia from 2 to 3 (#192) (@dependabot[bot])
- Bump codecov/codecov-action from 6 to 7 (#193) (@dependabot[bot])
- ci(fix): cap
BenchmarkToolstest compat at~1.6(#194) (@adrhill) - Bump actions/checkout from 6 to 7 (#195) (@dependabot[bot])
- ci: standardize linting, import hygiene, and CI workflows (#196) (@adrhill)
- feat: support AD backend selection in
SmoothGradandIntegratedGradients(#197) (@adrhill) - fix(docs): update Flux model to
v0.16.12(#198) (@adrhill) - fix: single forward pass in gradient analyzers, correct
IntegratedGradients(#199) (@adrhill) - feat!: update to XAIBase
v5(#200) (@adrhill)
Closed issues:
- Bug: Gradient-based analyzers compute two forward passes instead of one (#186)