Programming Assignment 4 DL Applications in Computer Vision
Programming Assignment 4 DL Applications in Computer Vision
1. Programming assignments will be evaluated automatically. Do not change the skeleton code
provided to you.
2. Write your code only in the designated places in the skeleton code and process the input data
provided to you in the designated variables. Do not alter the input-output structure in the
skeleton code.
3. Do not import any additional libraries. Do not use any additional files for the processing
(other than those mentioned in the skeleton code).
4. Failure to comply with these instructions may lead to you getting zero marks for the
assignment, even if the solution is largely correct.
Problem: Write a Python program using the provided template to train and test a partial MNIST
dataset using a modified AlexNet as shown below. The program should accept three integers as
command line input. First two integers define the labels of the two-class classification and third integer
represents the number of epochs for training. Output only the final model accuracy and nothing else.
Feature Extractor:
Classifier:
Instructions: Download the dataset along with template program and write your code in the
designated location mentioned in the comments only. You are required only to write the sequential
model for feature extractor, classifier and forward (feature extractor THEN classifier). The dataset
must be in the current working directory with the structure data/MNIST/raw/*. You should read the
skeleton code to understand the exact mechanism of input from the command line and provide the
required output. To train and test modified AlexNet with 1 and 2 MNIST classes with 4 training epochs,
the command line input should be: python assignment.py 1 2 4
Input 4 5 3 1 2 3 1 2 2 4 9 3 8 7 5
Output 97.97 97.52 78.10 79.41 95.21