mustkhan / Machine-Learning-Playbook

A collection of useful code, programs, notes and much more on machine learning!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The ML Playbook

The Machine Learning Playbook 📕

Introduction

This is a collection of useful code, programs, notes and much more on machine learning. My goal is to practice and demonstrate my understanding of foundational, intermediate and advanced concepts in machine learning by building it all from scratch!

The Mathematics Behind Neural Networks

To begin with, "The Mathematics Behind Neural Networks" outlines my understanding of how NNs work as well as includes a demonstration of taking the foundtional mathematics and programming a NN from scratch in Python. Acknowledgement: Aditya, a friend of mine, was kind enough to walk me through his writeup on the mathematics behind NNs and explain key concepts such as backpropagation. My work is based on the conversation I had with him as well as his writeup.

NN Math

Dense NNs and Multi-Layer Perceptrons (on MNIST and Fashion MNIST Datasets)

Next, I made a Dense NN that could classify hand written digits on MNIST and then redid the same project but with a MLP network. I also made an MLP that could distinguish between the classes in the Fashion MNIST dataset.

MNIST Fashion MNIST

Convolutional Neural Networks

Developing my understanding of Convolutional Neural Networks by creating a CNN model architecture and using it to classify objects found in the CIFAR-10 Dataset. A future goal is to create a mathematical document outlining how CNN works as well as an implementation completely from scratch in order to test this understanding.

CIFAR-10

Transfer Learning

I used the architecture and weights of VGG-16 while modifying the final, classifier layer on a cats and dogs dataset.

Cat And Dog

Style Transfer

Inspired by the paper: Image Style Transfer Using Convolutional Neural Networks, by Gatys, I implemented Style Transfer. By using gradient descent to optimize a total loss function (made of a content loss and a style loss), the network manages to extract the content of the content image and the style of the style image in order to produce the target image.

Style Transfer Style Transfer Demo

RNNs And LSTMs

By creating a network based off of Andrej Karpathy's post on RNNs that uses LSTMs, I created a model that is able to generate new text based on text samples or inputs. In this case, I trained the model on Anna Karenina by Leo Tolstoy. The following is an output of the model after being trained:

LSTM Text Generation

Converting Trained NNs To Different Formats

A lot of RND work is done using Pytorch. However, deploying models on edge devices usually requires a conversion to ONNX or to (Tensorflow and then) Tensorflow Lite. This notebook covers this conversion process.

About

A collection of useful code, programs, notes and much more on machine learning!


Languages

Language:Jupyter Notebook 100.0%