Autograd engine and neural network library based on numpy.
Inspired by Andrej Karpathy's micrograd.
Unlike micrograd which uses scalars, centigrad uses vectors.
git clone https://github.com/dinesh-GDK/centigrad.git
pip install -e centigrad
centigrad has the basic building blocks to construct Fully Connected Neural Networks and 2D Convolution Neural Networks.
- Flatten
- Fully Connected
- 2D Convolution
- 2D Max Pooling
- 2D Dropout
- 2D Batch Normalization
- ReLu
- Tanh
- Softmax
- Mean Square Error
- Cross Entropy
- Gradient Descent
Here is an example of how a model is defined in centigrad
class MnistNet(Model):
def __init__(self):
super().__init__()
self.layerc1 = Conv2d(1, 2)
self.maxpool = MaxPool2d()
self.dropout = Dropout2d()
self.batchnorm = BatchNorm2d(2)
self.flatten = Flatten()
self.layer1 = FullyConnected(338, 10)
def forward(self, x):
x = relu(self.layerc1(x))
x = self.maxpool(x)
x = self.dropout(x)
x = self.batchnorm(x)
x = self.flatten(x)
x = softmax(self.layer1(x))
return x
See demo notebook for more details