This file contains hidden or 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
import math | |
class Var: | |
def __init__(self, val: float, local_gradients=()): | |
self.val = val | |
self.local_gradients = local_gradients | |
self.grad = 0 | |
def backward(self, path_value: float = 1): | |
for child_var, local_gradient in self.local_gradients: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
