Assignment 4 CS 539 solved

$30.00

Original Work ?

Download Details:

  • Name: HomeWork4-5v6szi.zip
  • Type: zip
  • Size: 590.81 KB

Category: Tags: , You will Instantly receive a download link upon Payment||Click Original Work Button for Custom work

Description

5/5 - (1 vote)

Part 1. Softmax regression [60 points]
In this part, you will implement softmax regression (in problem1.py) with stochastic gradient descent in
python3.
We provide the following files:
a) problem1.py – You will implement several functions of softmax regression. Do not change the input and
the output of the functions.
b) test1.py – This file includes unit tests. Run this file by typing ‘pytest -v test1.py’ in the terminal. No
modification is required.
Part 2. Adding CNN and fully connected layers to recognize handwritten digits on PyTorch [40 points]
In this part, you will deal with the MNIST Database [1]. The MNIST Database is a collection of samples of
handwritten digits from many people, originally collected by the National Institute of Standards and
Technology (NIST), and modified to be more easily analyzed computationally. We will use a tutorial and
sample software provided:
• Read and run a tutorial [2] to be familiar with how to add CNN layers into PyTorch.
• Download hw4-part2.ipynb and run it to be familiar with the code. Currently it contains two fully connected
layers with softmax.
• Your job is to add one CNN layer with one pooling layer before the two fully connected layers with softmax.
Refer to the detailed instruction about the CNN layer. The main difference between the tutorial and this
given hw4_part2.ipynb is the input image of hw4_part2.ipynb has only 1 channel (i.e., gray scale).
Report results of two fully connected layers without CNN and with CNN.
• Then, experiment with at least 3 alternative network topologies and hyper-parameters (e.g., different # of
CNN/fully-connected layers, # of epochs, # of hidden units, learning rate, batch size, and different activation
functions).
• Save and summarize the results and report them.
• Through the experiment, what is the best configuration? What prediction accuracy on the test set you got?
What did you learn?
What to turn in:
 Submit to Canvas your problem1.py and pdf document for part 2.
 This is an individual assignment.
[1] MNIST Database: https://pytorch.org/vision/stable/generated/torchvision.datasets.MNIST.html
[2] Tutorial: https://pytorch.org/tutorials/beginner/blitz/cifar10_tutorial.html