Update example in README
This commit is contained in:
parent
a3afa0c797
commit
a7004274f5
|
@ -7,11 +7,13 @@ Neural network library written in Python completely from scratch, using only num
|
|||
```
|
||||
import nn
|
||||
|
||||
a = nn.Tensor(1), b = nn.Tensor(2)
|
||||
a, b = Tensor(2), Tensor(3)
|
||||
c = a.mul(b)
|
||||
c.backward()
|
||||
d = c.exp()
|
||||
d.backward()
|
||||
|
||||
print(a.grad, b.grad) # should output (2, 1)
|
||||
print(a.grad, b.grad, c.grad)
|
||||
# should output (1210.2863804782053, 806.8575869854702, 403.4287934927351)
|
||||
```
|
||||
|
||||
## References
|
||||
|
|
Loading…
Reference in New Issue