Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Pytorch | 71,077 | 3,341 | 6,728 | 16 hours ago | 37 | May 08, 2023 | 12,759 | other | Python | |
Tensors and Dynamic neural networks in Python with strong GPU acceleration | ||||||||||
Pytorch Tutorial | 27,137 | a month ago | 85 | mit | Python | |||||
PyTorch Tutorial for Deep Learning Researchers | ||||||||||
Examples | 20,784 | 24 days ago | 185 | bsd-3-clause | Python | |||||
A set of examples around pytorch in Vision, Text, Reinforcement Learning, etc. | ||||||||||
Awesome Pytorch List | 14,103 | 4 months ago | 4 | |||||||
A comprehensive list of pytorch related content on github,such as different models,implementations,helper libraries,tutorials etc. | ||||||||||
Nlp Tutorial | 12,403 | 6 months ago | 34 | mit | Jupyter Notebook | |||||
Natural Language Processing Tutorial for Deep Learning Researchers | ||||||||||
Pytorch Book | 10,517 | 10 months ago | 133 | mit | Jupyter Notebook | |||||
PyTorch tutorials and fun projects including neural talk, neural style, poem writing, anime generation (《深度学习框架PyTorch:入门与实战》) | ||||||||||
The Incredible Pytorch | 9,479 | 7 months ago | 1 | mit | ||||||
The Incredible PyTorch: a curated list of tutorials, papers, projects, communities and more relating to PyTorch. | ||||||||||
Pytorch Tutorial | 7,372 | 6 months ago | 28 | mit | Jupyter Notebook | |||||
Build your neural network easy and fast, 莫烦Python中文教学 | ||||||||||
Stanza | 6,783 | 2 | 87 | 17 hours ago | 18 | March 14, 2023 | 78 | other | Python | |
Stanford NLP Python library for tokenization, sentence segmentation, NER, and parsing of many human languages | ||||||||||
Micrograd | 6,116 | 2 | 21 days ago | 1 | April 18, 2020 | 28 | mit | Jupyter Notebook | ||
A tiny scalar-valued autograd engine and a neural net library on top of it with PyTorch-like API |
A tiny Autograd engine (with a bite! :)). Implements backpropagation (reverse-mode autodiff) over a dynamically built DAG and a small neural networks library on top of it with a PyTorch-like API. Both are tiny, with about 100 and 50 lines of code respectively. The DAG only operates over scalar values, so e.g. we chop up each neuron into all of its individual tiny adds and multiplies. However, this is enough to build up entire deep neural nets doing binary classification, as the demo notebook shows. Potentially useful for educational purposes.
pip install micrograd
Below is a slightly contrived example showing a number of possible supported operations:
from micrograd.engine import Value
a = Value(-4.0)
b = Value(2.0)
c = a + b
d = a * b + b**3
c += c + 1
c += 1 + c + (-a)
d += d * 2 + (b + a).relu()
d += 3 * d + (b - a).relu()
e = c - d
f = e**2
g = f / 2.0
g += 10.0 / f
print(f'{g.data:.4f}') # prints 24.7041, the outcome of this forward pass
g.backward()
print(f'{a.grad:.4f}') # prints 138.8338, i.e. the numerical value of dg/da
print(f'{b.grad:.4f}') # prints 645.5773, i.e. the numerical value of dg/db
The notebook demo.ipynb
provides a full demo of training an 2-layer neural network (MLP) binary classifier. This is achieved by initializing a neural net from micrograd.nn
module, implementing a simple svm "max-margin" binary classification loss and using SGD for optimization. As shown in the notebook, using a 2-layer neural net with two 16-node hidden layers we achieve the following decision boundary on the moon dataset:
For added convenience, the notebook trace_graph.ipynb
produces graphviz visualizations. E.g. this one below is of a simple 2D neuron, arrived at by calling draw_dot
on the code below, and it shows both the data (left number in each node) and the gradient (right number in each node).
from micrograd import nn
n = nn.Neuron(2)
x = [Value(1.0), Value(-2.0)]
y = n(x)
dot = draw_dot(y)
To run the unit tests you will have to install PyTorch, which the tests use as a reference for verifying the correctness of the calculated gradients. Then simply:
python -m pytest
MIT