Last active
May 26, 2020 20:32
-
-
Save tswedish/33bc1738ffdba588436236d95efa53ed 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 backward(self, output_gradient=1.): | |
# combine gradients from other paths and propagate to children | |
self.gradient += output_gradient | |
local_gradient = self.derivative_op(*self.calc_input_values()) | |
for differential, input_variable in zip(local_gradient, self.input_variables): | |
input_variable.backward(differential * output_gradient) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment