Coder Social home page Coder Social logo

mattsankner / micrograd Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 6.5 MB

I build the Micrograd autogradient engine, which is a functioning neural network with forward pass, backward propagation, and stochastic gradient descent, all built from scratch. This is derived from the great @karpathy micrograd lecture. Each notebook is complete with Andrei's lecture code and speech, as well as my own code, anecdotes and addition

Home Page: https://www.youtube.com/watch?v=VMj-3S1tku0

License: MIT License

Jupyter Notebook 99.78% Python 0.22%
backward-propagation calculus neural-networks pytorch stochastic-gradient-descent binaryclassification derivatives machine-learning numpy

micrograd's Introduction

Micrograd Autograd Engine

In this series of notebooks, I build a bare-bones neural network (Multi-Layer Perceptron) with python. It is complete with forward pass, backpropogation, and stochastic gradient descent. To do this, I re-create Andrej Karpathy's YoutTube lecture, "The Spelled-out Intro to Neural Networks and Backpropagation: Building Micrograd." in a more byte-sized manner, complete with Andrei's and my own anecdotes. I separate concepts between notebooks so you can access multiple versions of the code throughout the lecture with different focuses in each notebook. This is a robust, and more step-by-step, readable, and workbook like version of how you might learn the concepts required to build Micrograd.

We will build Micrograd with 100 lines of Python code, as well as build a library on top of Micrograd for the neurons, layers, and MLP's! Agenda, concepts, and important links are below.

Agenda & Concepts:

  • Building micrograd, an autogradient engine that can evaluate the gradient of a loss function for the weights of a neural network
  • Neural Networks as math expressions
  • Calcualting derivatives to update the weights using the chain rule
  • Building a topological graph of nodes to illustrate this process
  • Elements of a neural network from neuron to multi-layer perceptron
  • The flow of training a neural network -> forward pass, backward pass, gradient descent, optimization
  • Common issues
  • Build a binary classifier that uses micrograd at the end

Notebooks (Meant to be completed in order)

Notebook 1: Derivatives

Open In Colab View in nbviewer

Notebook 2: Chain Rule

Open In Colab View in nbviewer

Notebook 3: Backpropagation

Open In Colab View in nbviewer

Notebook 4: Activation

Open In Colab View in nbviewer

Notebook 5: PyTorch

Open In Colab View in nbviewer

Notebook 6: Gradient Descent

Open In Colab View in nbviewer

Notebook 7: Final

Open in Colab View in nbviewer

Notebook 8: Binary Classifier Exercise

Open In Colab View in nbviewer

Andrej's code/github:

  • Open In Colab Code Part 1 of Video
  • Open In Colab Code Part 2 of Video
  • Open In Colab Solutions

Andrej's Video: Watch on YouTube

micrograd's People

Contributors

mattsankner avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.