Package: nano-autograds
Nano-AutoGradThis project provides a lightweight Python micro-framework for building and training neural networks from scratch based on automatic differentiation and computational graph engine.InstallationIntroductionNano-AutoGrad is a micro-framework that allows you to build and train neural networks from scratch based on automatic differentiation and computational graphs.InstallationYou can install Nano-AutoGrad using pip:pipinstallnano-autogradsFeaturesNano-AutoGrad offers the following features:Automatic Differentiation: Nano-AutoGrad automatically * computes gradients, making it easy to perform gradient-based optimization.Computational Graph Engine: It leverages a computational graph representation to efficiently compute gradients and perform backpropagation.Lightweight and Efficient: Nano-AutoGrad is designed to be lightweight and efficient, suitable for small to medium-sized neural networks.Easy-to-Use API: The framework provides a simple and intuitive API, allowing users to define and train neural networks with ease.Integration with NumPy: Nano-AutoGrad seamlessly integrates with NumPy, enabling efficient array operations and computations.UsageTo get started with Nano-AutoGrad, refer to the documentation for detailed usage instructions, examples, and API reference. Here are some basic steps to build and train a neural network using Nano-AutoGrad:examples 1 :importnumpyasnpimportautograd.core.nnasnnimportautograd.torch.optimasnnclassMyNeuralNetwork(na.Module):def__init__(self):self.linear=na.Linear(2,1)defforward(self,x):returnself.linear(x)network=MyNeuralNetwork()optimizer=na.SGD(network.parameters(),lr=0.1)Example 2 :
building 'Linear Model' using torch autograd engineimportautograd.torch.nnasnnimportautograd.torch.tensorasTensorimportautograd.torch.optimasSGDimportautograd.functionaasFclassModel(nn.Module):def__init__(self):super().__init__()self.l1=nn.Linear(784,1568,name='l1')self.l2=nn.Linear(1568,392,name='l2')self.l3=nn.Linear(392,10,name='l3')defforward(self,x):z=F.relu(self.l1(x))z=F.relu(self.l2(z))out=F.log_softmax(self.l3(z))returnoutmodel=Model()optimizer=autograd.optim.SGD(model.parameters(),lr=5e-2,weight_decay=1e-4)scheduler=autograd.optim.lr_scheduler.LinearLR(optimizer,start_factor=1.0,end_factor=0.75,total_iters=num_epochs)ExamplesThe Nano-AutoGrad repository provides various examples demonstrating the usage of the framework for different tasks, such as linear regression, classification, and more. You can explore the examples directory in the repository to gain a better understanding of how to use Nano-AutoGrad in practice.
Contributing pleaseNano_AutoGrads_tutorial_Linear_modelNano_AutoGrads_tutorial_Sparse_NetworksUsing Nano-AutoGrads to classify MINIST handwritten digitsContributionsNano-AutoGrad are welcome! If you have any bug reports, feature requests, or want to contribute code, please open an issue or submit a pull request on the official GitHub repository.
LicenseNano-AutoGrad is released under the MIT License. Please see the LICENSE file in the repository for more details.
AcknowledgementsWe would like to thank the contributors and the open-source community for their valuable contributions to Nano-AutoGrad.
ContactFor any inquiries or further information, you can reach out to the project maintainer, Youness El Brag, via email atyouness.elbrag@example.com.Please note that you may need to update the contact email address with the appropriate one.Credits :microgradAndrej karpathyugradconscell