Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

CS 426, Spring 2023

Assignment Prefix: home02

Home Assignment  2

Due Date: 03/18/2023 (Saturday), 11:59 pm

Total Points: 40 Points (30 points + 10 points)

Purpose: To provide an initial introduction to foundations of Deep Learning and deploy sequential models using hidden layers.

Knowledge:  This assignment would be used to evaluate the knowledge and understanding you have gained from our discussion on Deep Learning fundamentals.

Skill: Upon successful completion you will be able to:

•    Understand how a perceptron works.

•    Understand how to combine neurons to create hidden layers.

•    Understand the basics of deep learning and parameters used to tune these models.

    Write simple programs in Python to deploy sequential models.

Task: Please refer to the slides and lecture notes to answer the questions.

Criteria: Refer to the rubric to see how many points have been assigned for each question.

Question 1:

For this task, you are to use your understanding of sequential modelling using neural networks and classify two

datasets. Here is the link:https://archive.ics.uci.edu/ml/datasets/wine+quality.

Winequality-red.csv and winequality-white.csv each contain 11 independent features which are used to predict the quality” of the wine. Here are some key points.

•    Use Google Colab to build your model.

•    Upload an HTML version of your Jupyter notebooks.

•    Since there are 6 different classes, you must make sure that your model is properly configured especially the input and output layers.

•    If you do use one-hot-encoding, make sure to adjust class values accordingly.

Read the uploaded paper on Iris_Plant_Classification and complete the following tasks w.r.t the wine datasets:

1.    Complete a section describing the two wine datasets. It should look like Section 3 of the paper where the authors talk about IRIS plant dataset.

2.    You are to create two separate Jupyter notebook files. Name one as Wine_21_Red for processing Winequality-red.csv and another as Wine_21_White for processing Winequality-white.csv.

3.    Normalize ONLY your independent features in the dataset before you begin.Click herefor some information on normalizing.

4.    Each model should contain training and testing dataset. Since your dataset is not split into training and testing, make sure to do so before you begin. Use 70% for training and 30% for testing.

5.    Build your Sequential Neural Network model and call it Model_White for Wine_21_White.ipynb and Model_Red for Wine_21_ Red.ipynb such that both of them have 6 hidden layers with the following  configuration.

•    Hidden layer 1 = 60 neurons

•    Hidden layer 2 = 50 neurons

•    Hidden layer 3 = 40 neurons

•    Hidden layer 4 = 30 neurons

•    Hidden layer 5 = 20 neurons

•    Hidden layer 6 = 10 neurons.

6.    Compile your model.

7.    Fit your model and use 30% for validation in both files. Use a batch size of 20 and 25 epochs.

8.    Plot your loss and accuracy of training and validation datasets.

9.    Evaluate the model on test datasets, estimate the accuracy and the confusion matrix.

10.  Repeat steps 6-8 using epochs 50, 100, 200.

11.  Repeat steps 5-10 but this time build another Sequential Neural Network model and call it                                  Model_White_Modified for Wine_21_White.ipynb and  Model_Red_Modified for Wine_21_Red.ipynb such that both of them have 6 hidden layers with dropouts of 0.2 between every hidden layer as shown. Refer to  the followinglinkto understand dropout implementation. Just make sure you are usingdropoutsin Keras      from TensorFlow 2.0. You may see a lot of parameters but keep in mind that they are optional.

12. Summarize your findings in a report.

13.  Use the uploaded paper as a guideline to write the report. Note that this paper is meant to give you some idea on how to compile the report. The objective of the paper is different from the objective of this assignment.

14. Your report should not contain anything that mimics Section 2 in the paper.

15. Your report should contain a small Introduction explaining what you are trying to achieve.

16. Your report should contain a Section 4 equivalent to the one shown in the paper explaining your models. You can use sub-sections for the different datasets.

17. Your report should contain a Section 5 equivalent that explains the results.

18. Your report should contain a Conclusion.

19. You are free to use multiple plots generated in the experiments on your report. You can also use other      statistical software such as SPSS, SAS, Minitab or MS Excel to plot accuracy values based on the results       generated by fitting your model. Here is a demo table that you can use to create a story from your report.

 

Epochs

No dropout

With dropout of 20%

Training Accuracy

Validation Accuracy

Testing  Accuracy

Training Accuracy

Validation Accuracy

Testing  Accuracy

25

 

 

 

 

 

 

50

 

 

 

 

 

 

100

 

 

 

 

 

 

200

 

 

 

 

 

 

20.  Finally draw some conclusion from the report. Some questions you could answer include but are limited to:

a.    Did I overfit? If so, was it due to epochs?

b.    Could I tweak around with batch size to get higher accuracy? (This is not required but you are free to explore)

c.    Is my dropout a bit higher than what should be?

Remember, it is your story so explain it the best way you think is necessary. You don’t have to answer every question. Pick one and compile your report around that question. Make that your specialty.

Question 2:

Read the paper on Neural Networks and Statistical Models to answer the following questions. Each question carries 2 points.

1.    In the section titled Models and Algorithms, why does the author mention Standard NN learning algorithms as inefficient?

2.    Summarize the discussion on Perceptrons with respect to Figures 3, 4, 5 and 6.

3.    How is a multi-layer perceptron different from simple perceptron? (Hint: Read the first paragraph of Multilayer Perceptrons and look at the difference between Figures 3-6 w.r.t Figure 7)

4.    What is the difference between the MLP architectures in Figures 8 and 9?

5.    What is the authors suggestion on how to vary the complexity of the MLP model? Summarize in 4-5 sentences.

To turn in your assignment

1.   One report in pdf format for question 1. (Minimum page size is 4 with a font size of 11 in Calibri/12 in Times New Roman).

2.   Two Jupyter notebook files in HTML format containing your code for question 1.

3.   One pdf file with all answers for question 2.