xai4tsc.utils.animation
Perturbation-process animations (GIF) for the frequency / time-frequency metrics.
Each animation shows a single sample’s perturbation trajectory over the metric’s
flipping steps: the reconstructed time signal, the perturbed frequency /
time-frequency representation (with the static relevance), and the prediction
curve building up. Frames are produced by the perturbation metrics’ animate
method (opt-in frame collection); output is always a GIF via Matplotlib’s
built-in PillowWriter (no ffmpeg dependency).
Attributes
Classes
Animate a frequency-domain perturbation: spectrum + time signal + prediction. |
|
Animate a TF perturbation: relevance + spectrogram + time signal + prediction. |
Module Contents
- xai4tsc.utils.animation.logger
- class xai4tsc.utils.animation.FrequencyPerturbationAnimation(frames: dict, step: int = 1, max_frames: int = 300)
Bases:
_PerturbationAnimationAnimate a frequency-domain perturbation: spectrum + time signal + prediction.
- class xai4tsc.utils.animation.TimeFrequencyPerturbationAnimation(frames: dict, step: int = 1, max_frames: int = 300)
Bases:
_PerturbationAnimationAnimate a TF perturbation: relevance + spectrogram + time signal + prediction.