Giter Site home page Giter Site logo

2-layer-cnn-with-pytorch-fashion-mnist-'s Introduction

2-Layer-CNN-with-Pytorch-Fashion-MNIST-

I have used 2 layered CNN network, Autograd, Xavier weight and Avg-Pooling. Highest accuracy till now on test-data is 91.45%. For this project I have used Fashion MNIST dataset. It is a grayscale image of size 28*28. I have downloaded the train and test data from https://github.com/zalandoresearch/fashion-mnist. Data was in ubyte form so I used a function to convert data from ubyte to csv. The function takes ubyte image ,ubyte label and datasize as input and convert them into csv file having matrix of 10x786. Rows having labels of each images and columns having each pixels value. Then implemented a class that inherits the Dataset type and defines reading functions and data access. I loaded the csv file in dataset class and convert into numpy array and return image and label. Dataset having image and label to feed into Dataloader. Dataloader will actually read the data, batches it and shuffle it to prevent the overfitting on training data.

I have used Convolutional Neural Network to train the image because the pixel value in one region of an image can be related to other pixel values in same region, so assuming this fact CNN can work better. CNNs are used to learn Filter that when convoled with image it will extract the features.

I have used batch normalization to speed up the learning. Batch Normalization allows each layer of a network to learn by itself a little bit more independetly of other layers and it reduces overfitting because it has slight regularization effect.

Now I iterate over batch of images and lated the loss on every step. Using the backpropagation I updated our parameter so decreased the loss to get better accuracy. Then I evaluated them on my test data.

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.