sage.plotting.output_gradient
Filename : output_gradient.py Description : Short description of the file
Created on 2026-03-21 17:49:22
__author__ = Narenraju Nagarajan __copyright__ = Copyright 2026, ProjectName __license__ = MIT Licence __version__ = 0.0.1 __maintainer__ = Narenraju Nagarajan __affiliation__ = N/A __email__ = N/A __status__ = [‘inProgress’, ‘Archived’, ‘inUsage’, ‘Debugging’]
GitHub Repository: NULL
Documentation: NULL
Functions
|
Plot the empirical gradient of network output with respect to a source parameter. |
Module Contents
- plot_output_gradient(epoch, ranking_stat, labels, source_params, param_name, export_dir=None, save=True, window=5)[source]
Plot the empirical gradient of network output with respect to a source parameter.
Sorts signal events by
param_nameand estimates the finite-difference gradient of the ranking statistic with a rolling window. A rising gradient indicates the network exploits this parameter; a flat curve indicates insensitivity.- Parameters:
epoch (int or str) – Epoch identifier for the title and filename.
ranking_stat (array-like, shape
(N,)) – Network ranking statistics.labels (array-like, shape
(N,)) – Binary labels.source_params (dict[str, array-like]) – Per-event parameter arrays.
param_name (str) – Key of the parameter to differentiate against.
export_dir (str or None) – Output directory.
save (bool) – If
True, save to disk; otherwise display.window (int) – Rolling-window width for smoothing the gradient estimate (default
5).