Coder Social home page Coder Social logo

amanchadha / stanford-cs231n-assignments-2020 Goto Github PK

View Code? Open in Web Editor NEW
154.0 5.0 65.0 204.32 MB

This repository contains my solutions to the assignments for Stanford's CS231n "Convolutional Neural Networks for Visual Recognition" (Spring 2020).

Shell 0.02% Jupyter Notebook 98.83% Python 1.15%
cs231n cs231n-assignment cs231 stanford stanford-machine-learning computer-vision deep-learning convolutional-neural-networks recurrent-neural-networks cnns

stanford-cs231n-assignments-2020's Introduction

CS231n: Convolutional Neural Networks for Visual Recognition - Assignment Solutions

This repository contains my solutions to the assignments for Stanford's CS231n "Convolutional Neural Networks for Visual Recognition" course (Spring 2020).

Stanford's CS231n is one of the best ways to dive into Deep Learning in general, in particular, into Computer Vision. If you plan to excel in another subfield of Deep Learning (say, Natural Language Processing or Reinforcement Learning), we still recommend that you start with CS231n, because it helps build intuition, fundamental understanding and hands-on skills. Beware, the course is very challenging!

To motivate you to work hard, here are actual applications that you'll implement in A3 - Style Transfer and Class Visualization.

For the one on the left, you take a base image and a style image and apply the "style" to the base image (reminds you of Prisma and Artisto, right?). The example on the right is a random image, gradually perturbed in a way that a neural network classifies it more and more confidently as a gorilla. DIY Deep Dream, isn't it? And it's all math under the hood, it's cool to figure out how it all works. You'll get to this understanding with CS231n, it'll be hard but at the same time an exciting journey from a simple kNN implementation to these fascinating applications. If you think that these two applications are eye-catchy, then take another look at the picture above - a Convolutional Neural Network classifying images. That's the basics of how machines can "see" the world. The course will teach you both how to build such an algorithm from scratch and how to use modern tools to run state-of-the-art models for your tasks.

Find course notes and assignments here and be sure to check out the video lectures for Winter 2016 and Spring 2017!

Assignments have been completed using both TensorFlow and PyTorch.

Assignment #1: Image Classification, kNN, SVM, Softmax, Neural Network

Q1: k-Nearest Neighbor Classifier

  • Test accuracy on CIFAR-10: 0.282

Q2: Training a Support Vector Machine

  • Test accuracy on CIFAR-10: 0.376

Q3: Implement a Softmax classifier

  • Test accuracy on CIFAR-10: 0.355

Q4: Two-Layer Neural Network

  • Test accuracy on CIFAR-10: 0.501

Q5: Higher Level Representations: Image Features

  • Test accuracy on CIFAR-10: 0.576

Assignment #2: Fully-Connected Nets, Batch Normalization, Dropout, Convolutional Nets

Q1: Fully-connected Neural Network

  • Validation / test accuracy on CIFAR-10: 0.547 / 0.539

Q2: Batch Normalization

Q3: Dropout

Q4: Convolutional Networks

Q5: PyTorch / TensorFlow v2 on CIFAR-10 / TensorFlow v1 (Tweaked TFv1 model)

  • Training / validation / test accuracy of TF implementation on CIFAR-10: 0.928 / 0.801 / 0.822
  • PyTorch implementation:
Model Training Accuracy Test Accuracy
Base network 92.86 88.90
VGG-16 99.98 93.16
VGG-19 99.98 93.24
ResNet-18 99.99 93.73
ResNet-101 99.99 93.76

Assignment #3: Image Captioning with Vanilla RNNs, Image Captioning with LSTMs, Network Visualization, Style Transfer, Generative Adversarial Networks

Q1: Image Captioning with Vanilla RNNs

Q2: Image Captioning with LSTMs

Q3: Network Visualization: Saliency maps, Class Visualization, and Fooling Images (PyTorch / TensorFlow v2 / TensorFlow v1)

Q4: Style Transfer (PyTorch / TensorFlow v2 / TensorFlow v1)

Q5: Generative Adversarial Networks (PyTorch / TensorFlow v2 / TensorFlow v1)

Course notes

GPUs

For some parts of the 3rd assignment, you'll need GPUs. Kaggle Kernels or Google Colaboratory will do.

Useful links

Direct links to Spring 2017 lectures

Disclaimer

I recognize the hard time people spend on building intuition, understanding new concepts and debugging assignments. The solutions uploaded here are only for reference. They are meant to unblock you if you get stuck somewhere. Please do not copy any part of the solutions as-is (the assignments are fairly easy if you read the instructions carefully).

stanford-cs231n-assignments-2020's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  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.