mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-09 15:08:02 -05:00
oops, set to None
This commit is contained in:
@@ -67,8 +67,3 @@ loss.backward()
|
|||||||
optim.step()
|
optim.step()
|
||||||
```
|
```
|
||||||
|
|
||||||
### TODO (to make real neural network library)
|
|
||||||
|
|
||||||
* Implement gradcheck (numeric)
|
|
||||||
* Make convolutions not slow while removing lines of code (NO CYTHON!)
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ try:
|
|||||||
builtins.__dict__['profile'] = prof
|
builtins.__dict__['profile'] = prof
|
||||||
# add @profile decorator to probe
|
# add @profile decorator to probe
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
prof = None
|
||||||
|
|
||||||
import cProfile
|
import cProfile
|
||||||
import unittest
|
import unittest
|
||||||
|
|||||||
@@ -34,11 +34,11 @@ def fetch_mnist():
|
|||||||
def im2col(x, H, W):
|
def im2col(x, H, W):
|
||||||
bs,cin,oy,ox = x.shape[0], x.shape[1], x.shape[2]-(H-1), x.shape[3]-(W-1)
|
bs,cin,oy,ox = x.shape[0], x.shape[1], x.shape[2]-(H-1), x.shape[3]-(W-1)
|
||||||
|
|
||||||
|
# TODO: use something like np.take for speed
|
||||||
tx = np.empty((bs, oy, ox, cin*W*H), dtype=x.dtype)
|
tx = np.empty((bs, oy, ox, cin*W*H), dtype=x.dtype)
|
||||||
for Y in range(oy):
|
for Y in range(oy):
|
||||||
for X in range(ox):
|
for X in range(ox):
|
||||||
tx[:, Y, X] = x[:, :, Y:Y+H, X:X+W].reshape(bs, -1)
|
tx[:, Y, X] = x[:, :, Y:Y+H, X:X+W].reshape(bs, -1)
|
||||||
|
|
||||||
return tx.reshape(-1, cin*W*H)
|
return tx.reshape(-1, cin*W*H)
|
||||||
|
|
||||||
def col2im(tx, H, W, OY, OX):
|
def col2im(tx, H, W, OY, OX):
|
||||||
|
|||||||
Reference in New Issue
Block a user