replace layer_init_uniform with .uniform

This commit is contained in:
George Hotz
2020-12-06 13:44:31 -08:00
parent c71a8ef222
commit 102e6356e9
5 changed files with 15 additions and 17 deletions

View File

@@ -57,12 +57,11 @@ It turns out, a decent autograd tensor library is 90% of what you need for neura
```python
from tinygrad.tensor import Tensor
import tinygrad.optim as optim
from tinygrad.utils import layer_init_uniform
class TinyBobNet:
def __init__(self):
self.l1 = Tensor(layer_init_uniform(784, 128))
self.l2 = Tensor(layer_init_uniform(128, 10))
self.l1 = Tensor.uniform(784, 128)
self.l2 = Tensor.uniform(128, 10)
def forward(self, x):
return x.dot(self.l1).relu().dot(self.l2).logsoftmax()