Last active
November 20, 2021 16:09
-
-
Save shayaf84/d45e4b06f2d77710c2cff7c5abc76c2e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def integralEstimates(gradients): | |
# riemann_trapezoidal | |
grads = (gradients[:-1] + gradients[1:]) / tf.constant(2.0) | |
integrated_gradients = tf.math.reduce_mean(grads, axis=0) | |
return integrated_gradients | |
integ = integralEstimates(gradients=computedGradients) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment