Repository Details
Shared by
HelloGitHub Rating
0 ratings
Free•MIT
Claim
Discuss
Collect
Share
26.7k
Stars
No
Chinese
Python
Language
Yes
Active
355
Contributors
212
Issues
Yes
Organization
0.9.2
Latest
3k
Forks
MIT
License
More
一款小型的开源深度学习框架。它代码不足 1k 行足够简单,支持深度模型推理与训练。示例代码:
```python
from tinygrad.tensor import Tensor
import tinygrad.optim as optim
class TinyBobNet:
def __init__(self):
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()
model = TinyBobNet()
optim = optim.SGD([model.l1, model.l2], lr=0.001)
# ... and complete like pytorch, with (x,y) data
out = model.forward(x)
loss = out.mul(y).mean()
optim.zero_grad()
loss.backward()
optim.step()
```
Comments
Rating:
No comments yet