Giter Club home page Giter Club logo

stochastic-gradient-descent's Introduction

stochastic-gradient-descent

handwritten digits classifier (using the MNIST dataset, separates '0' and '8')

The MNIST dataset consists of images of handwritten digits, along with their labels. Each image has 28×28 pixels, where each pixel is in grayscale scale, and can get an integer value from 0 to 255. Each label is a digit between 0 and 9. The dataset has 70,000 images. Althought each image is square, we treat it as a vector of size 28×28 = 784.

In the file there is a helper function. The function reads the examples labelled 0, 8 and returns them with 0−1 labels.

in SGD we have to select external parameters η0 and C, we will use the training set to train classifiers for various parameter values and use the validation set to check how well they do.

we try to optimize η0 and C.

SGD Algorithm:

  • at each iteration t = 1,...T we sample i uniformly;
    • if yiwtxi < 1, we update:
      • wt+1 = (1 − ηt)wt + ηtCyi*xi
    • else :
      • wt+1 = (1 − ηt)wt
    • where ηt = η0/t, and η0 is a constant.

stochastic-gradient-descent's People

Contributors

ozgranit avatar

Watchers

James Cloos 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.