Compare commits
2 Commits
8788404350
...
a3afa0c797
Author | SHA1 | Date |
---|---|---|
Aodhnait Étaín | a3afa0c797 | |
Aodhnait Étaín | 46a7f327ce |
|
@ -3,4 +3,3 @@ include/
|
|||
lib/
|
||||
lib64
|
||||
pyvenv.cfg
|
||||
|
||||
|
|
13
nn.py
13
nn.py
|
@ -102,7 +102,18 @@ class Tensor:
|
|||
|
||||
tensor._back = back
|
||||
return tensor
|
||||
|
||||
|
||||
def exp(self):
|
||||
tensor = Tensor(np.exp(self.value))
|
||||
tensor._save(self)
|
||||
|
||||
def back(upstream):
|
||||
a, = tensor._parents
|
||||
return [ np.exp(a.value) ]
|
||||
|
||||
tensor._back = back
|
||||
return tensor
|
||||
|
||||
def _backprop(tensor, upstream):
|
||||
# Backprop through the tensor iff it has any parents.
|
||||
if tensor._parents is not None:
|
||||
|
|
Loading…
Reference in New Issue