oops, set to None

This commit is contained in:
George Hotz 2020-10-25 08:28:18 -07:00
parent 935f5ddaaa
commit c74764bac3
3 changed files with 2 additions and 7 deletions

View File

@ -67,8 +67,3 @@ loss.backward()
optim.step()
```
### TODO (to make real neural network library)
* Implement gradcheck (numeric)
* Make convolutions not slow while removing lines of code (NO CYTHON!)

View File

@ -6,7 +6,7 @@ try:
builtins.__dict__['profile'] = prof
# add @profile decorator to probe
except ImportError:
pass
prof = None
import cProfile
import unittest

View File

@ -34,11 +34,11 @@ def fetch_mnist():
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)
# TODO: use something like np.take for speed
tx = np.empty((bs, oy, ox, cin*W*H), dtype=x.dtype)
for Y in range(oy):
for X in range(ox):
tx[:, Y, X] = x[:, :, Y:Y+H, X:X+W].reshape(bs, -1)
return tx.reshape(-1, cin*W*H)
def col2im(tx, H, W, OY, OX):