Rename integrated_gradient_trapezoidaljacobian[functional|squared] to calcedge[functional|squared]
Change normalization to happen after the squaring of our J matrix in calc_edge_squared
Combine "scaler" and "interval_size" to a single variable trapezoidal_scalar
Various cleanups to make it more consistent with the new pseudocode
Motivation and Context
Bug in implementation where the normalization was happening before the squaring. Probably doesn't affect much.
How Has This Been Tested?
No new tests. Note that our numbers will be bigger with this method since we are normalizing by 1/|D| instead of (effectively) 1/|D|^2. I don't expect this should affect anything, especially in float64, but it may be that this scaling makes precision errors worse? (Since we're just doing float64 for everything pythia-14m and upwards, I don't see this as a big issue.)
Does this PR introduce a breaking change?
Calculating edges will now give different (more correct) results.
Normalize after squaring in jacobian squared
Description
Motivation and Context
Bug in implementation where the normalization was happening before the squaring. Probably doesn't affect much.
How Has This Been Tested?
No new tests. Note that our numbers will be bigger with this method since we are normalizing by 1/|D| instead of (effectively) 1/|D|^2. I don't expect this should affect anything, especially in float64, but it may be that this scaling makes precision errors worse? (Since we're just doing float64 for everything pythia-14m and upwards, I don't see this as a big issue.)
Does this PR introduce a breaking change?
Calculating edges will now give different (more correct) results.