Giter VIP home page Giter VIP logo

neural-network-for-multi-class-classification-'s Introduction

Neural network for multi class classification

a.

  1. Run the code of 2 layer neural network from for multi class classification
  2. https://stackabuse.com/creating-a-neural-network-from-scratch-in-python-multi-class-classification/
  3. Go through the code and understand each line.
  4. Build the artificial dataset as shon in the blog.
  5. Take 70% data for training. 30% data for testing
  6. Build a two-layer neural network from from scratch where zo is the output.
    a) You will have two layers.
    i) One is hidden layers ( use 4 neurons)
    ii) three output layer (use one output neuron)
    b) Use sigmoid function as activation function in hidden layers
    c) Use softmax for output layer
    d) Use negative log likelihood loss
    e) Derive the derivative for softmax
    f) Calculate the derivatives for back propagation.
  7. Write codes training module for 2000 epochs to train the neural network.
  8. Now classify the test data using the trained neural network.
    a) During the test, you will do only forward pass.
    b) Argmax the forward pass output
    c) Report your accuracy.
  9. Draw data points for training data and also plot the class boundary in 3D plot
  10. Draw data points for test data and also plot the class boundary in 3D plot
  11. You cannot use any built-in deep learning functions


b. (same as a. But the input is 3X32X32 image, output 10 classes.. And three layer neural network

1) Download and read train data from CIFAR 10 from 10 classes
2) Now, read one image, reshape it to row vector x. x is our input data now with dimension 1X3072.
3) xโ€™s class label would be one hot encoded
4) Use two hidden layer and one output layer.
5) Build a three-layer neural network from scratch
a) You will have three layers.
i) First hidden layers ( use 1000 neurons)
ii) Second hidden layers (use 100 neurons)
iii) Output layers (10 output neurons)
b) So. Output-probability:
ao = softmax ( Wo * sigmoid ( Wh2 * sigmoid(Wh1 * x + bh1) + bh2 ) + bo )
c) Where x is input vector, Wh1, and Wh2 are weight matrices for hidden layers. Wo is the weight matrix for output layers. bh1, bh2, and bo are bias vectors for corresponding layers.
d) Use sum of cross entropy as your loss function. ao is the output vector.
e) Derive and Calculate the derivatives for back propagation for the three layer neural network.
6) Write codes for training module for 10 epochs to train the neural network.
7) Report your accuracy on the test set
8) Show confusion matrix of your test prediction
9) You cannot use any built-in deep learning functions


c. (use functions) โ€“

1) Download and read train data from CIFAR 10 from 10 classes
2) Same as assignment b.
3) Write forward(X) function to implement the forward calculation.
4) Use forward function to pass the input data to calculate the probabilities.
5) Calculate the loss using criterion function with cross entropy option.
6) Using the loss, use autograd and backward() to calculate the derivatives automatically.
7) Write codes for training module for 10 epochs to train the neural network.
8) Report your accuracy on the test set
9) Show confusion matrix of your test prediction

neural-network-for-multi-class-classification-'s People

Contributors

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