Assignments


Final: (due Friday May 16, 2025)

This is a take-home Final Exam. You may ask questions of the Professor or search Google. This is exam is to be completed independently.
Submit your .qmd or .ipynb and a .html, or Shared links. So you should submit three .qmd or .ipynb files and the corresponding .html files.

Part 1: Make an Quarto notebook with the file name lastname_firstname_Stat654_final_part1.qmd and do the following:

Read the excellent blog post from the Data Science Heroes website, How to create a sequential model in Keras for R.

Run all of the code in this blog post in your Quarto Notebook and explain each step presented. Clearly describe what kind of neural network is being fitted.

Change the neural network to use units = 4 for the first hidden layer and units = 2 for the second layer. Change the number of epochs = 40 in the fit(). How well does this neural network perform compared to the original neural network run?

Part 2: Make an Quarto Notebook with the file name lastname_firstname_Stat654_final_part2.qmd and do the following:

Go to Alex Krizhevsky website and look over the The CIFAR-10 dataset. This is an interesting dataset with 10 different labeled classes of images.

Run all of the code from the Posit Keras website Example cfar10 or in Python cifar10_ccn_python and explain each step presented. Clearly describe what kind of neural network is being fitted.

First change the number of epochs to a value <= 50 (current value is 200, at the top), so it does not run forever. This program will take a long time to run. Does it appear that it has run long enough?

Suggestions: If you are having a hard time Rendering your Notebook into an .html file this code may be beyond the capability of your computer hardware. Try to reduce the epoch variable to 50 or less, maybe 20, to see if that helps. If that does not solve the problem, run the code outside of a Notebook and copy the relevant code into a .docx file and add your comments to that file.

Part 3: Make an Quarto notebook with the file name lastname_firstname_Stat654_final_part3.qmd and do the following:

Run all of the code from the Posit Keras website Example Timeseries classification from scratch or in Python Timeseries classification from scratch and explain each step presented. Clearly describe what kind of neural network is being fitted. Change the number of epochs = 100.

OR

Part 3: Alternative If you do not want to do the Timeseries classification from scratch example, you can do the following:

  1. Download ollama and run ollama run llama3.2:1b.

ollama pull ollama run llama3.2:1b

Install the R package ollamar or the Python library python-ollama.

Finally, set up the R package or Python library mall and run the examples.


Homework06: (not collected)

Using a Quarto Notebooks produce your output from running the code from the book related to Time Series data and Generative Deep Learning. Render your .qmd files to either Lastname_Firstname_Stat652_hw6.html. Use your own last name and first name in the filename. At the top of your first page you should include Name, Class, Section, and homework assignment.

The header of your Quarto Notebooks should include

---
title: "Stat. 654 Homework 6"
author: "Your name"
date: "May 12, 2025"
format:
  html:
    embed-resources: true
---

Problems:


Homework05: (complete by Monday May 5, 2025)

Using a Quarto Notebook produce your output from running the code from the book in Chapter 11. Render the .qmd files to either Lastname_Firstname_Stat652_hw3. Use your own last name and first name in the filename. At the top of your first page you should include Name, Class, Section, and homework assignment.

The header of your Quarto Notebooks should include

---
title: "Stat. 654 Homework 5"
author: "Your name"
date: "May 5, 2025"
format:
  html:
    embed-resources: true
---

Problems:


Project: (due Friday May 9, 2025)

Make a stylized picture. Using a Neural Network.

The goal of the Project is to run the style transfer code from Chapter 12 Section 3 on a picture of interest to you using a style of painting you like.

Next get the code from Chapter 12 Section 3, Neural Style Transfer, to run. R code Project.zip Python code Neural style transfer DeepDream


Midterm: (due Friday May 2, 2025)

Instructions: This is a take-home midterm. Your work is to be completed individually. You may use your book, Google, and questions can be asked of the instructor. You are not to share your code with others in the class.

Using an Quarto Notebook, Python Notebook or Shared Colab Notebook to produce your solutions to questions. Turn in your modified Quarto Notebook for the IMDB code and an updated ver02 of the code provided for question 4, submit your .qmd or .ipynb and a .html, or Shared links. So you should submit three .qmd or .ipynb files and the corresponding .html files.

  1. When using the Gradient Decent Algorithm and Backpropogation, in which direction do updates move?
  2. Explain what a Convolutional Neural Network is in words. How does a convnet compare to the traditional feedforward neural network?
  3. In Section 4.1 of the Deep Learning with R book, the IMDB example is presented. Explain what the data being fitted is and what the input layer does in the neural network used in that section. Run the code from that example, try adding dropout layer(s) to see if the fit can be improved. Explain each chunk of code in your Notebook and explain results of your code.
  4. Run the code from the book, A Computational Approach to Statistical Learning, from Chapter 8 casl Chapter 8. This example is related to the EMNIST dataset. Read the sample chapter Chapter 8. Use Meld to merge the changes from ver01 into ver02 of the Quarto Notebook. Your assignment is to run the code in ver02 and write clear explanations above each R code chunk. Be sure to explain what a Feed-forward Neural Network is and what the Convolutional layers are. Explain each chunk of code in your Notebook and explain results of your code.
  5. For the Fashion-MNIST data build the four models from these images. Explain each chunk of code in your Notebook and explain results of your code, which model has the highest test accuracy.

Question 4:


Homework04: (complete by Monday April 28, 2025)

Using two Quarto Notebook produce your output from running the code from the book in Chapter 8. Render the .qmd files to either Lastname_Firstname_Stat652_hw4.docx or .pdf. Use your own last name and first name in the filename. At the top of your first page you should include Name, Class, Section, and homework assignment.

The header of your Quarto Notebooks should include

---
title: "Stat. 654 Homework 4"
author: "Your name"
date: "April 20, 2025"
format:
  html:
    embed-resources: true
---

Submit: Submit your Quarto Notebook or shared Colab Notebook. You can share the Colab Notebook with me by providing the links in Canvas. If you use Quarto Notebook, you can submit both your .qmd and .html files. If you use Jupyter Notebooks, you can submit both your .ipynb and .html files. To have your work visible in Canvas your Notebooks need to be .html. I will not be running your .qmd or .ipynb files to view your work. - Read: Chapter 7 and Chapter 8

Problems:


Quiz: (due Friday April 25, 2025)

Build the most accurate Feed-Forward Neural Network, with one or two hidden layer, for the Google Tensorflow Playground XOR data. The Github repository TFPlayground has a tiny version of the NOR data.

Using the numeric columns in the dataset build a classification model for the label variable. Add a dropout layer using a rate of .5 and compare the results without dropout.

See the iris code from Week 1 as a template. Change the iris data to the XOR data. And finally refit the model using a .5 dropout rate.

Submit: Submit your Quarto Notebook or shared Colab Notebook. You can share the Colab Notebook with me by providing the links in Canvas. If you use Quarto Notebook, you can submit both your .qmd and .html files. If you use Jupyter Notebooks, you can submit both your .ipynb and .html files. To have your work visible in Canvas your Notebooks need to be .html. I will not be running your .qmd or .ipynb files to view your work.


Homework03: (complete by Monday April 14, 2025)

Using three Quarto or shared Colab Notebooks produce your output from running the code from the book in Chapter 5.

At the top of your first page of each Notebook you should include Name, Class, Section, and homework assignment.

The header of your Quarto Notebooks should include

---
title: "Stat. 654 Homework 3"
author: "Your name"
date: "April 14, 2025"
format:
  html:
    embed-resources: true
---

Submit: Submit your Quarto Notebooks or shared Colab Notebooks. You can share the Colab Notebooks with me by providing the links in Canvas. If you use Quarto Notebooks, you can submit both your .qmd and .html files. If you use Jupyter Notebooks, you can submit both your .ipynb and .html files. To have your work visible in Canvas your Notebooks need to be .html. I will not be running your .qmd or .ipynb files to view your work.


Homework02: (complete by Monday April 7, 2023)

Using three Quarto or shared Colab Notebooks produce your output from running the code from the book in Chapter 4.

At the top of your first page of each Notebook you should include Name, Class, Section, and homework assignment.

The header of your Quarto Notebooks should include

---
title: "Stat. 654 Homework 2"
author: "Your name"
date: "April 7, 2025"
format:
  html:
    embed-resources: true
---

Submit: Submit your Quarto Notebooks or shared Colab Notebooks. You can share the Colab Notebooks with me by providing the links in Canvas. If you use Quarto Notebooks, you can submit both your .qmd and .html files. If you use Jupyter Notebooks, you can submit both your .ipynb and .html files. To have your work visible in Canvas your Notebooks need to be .html. I will not be running your .qmd or .ipynb files to view your work.


Homework01: (complete by Monday March 24, 2025)

Using four separate Quarto or shared Colab Notebooks produce your output from running the code from the examples and from the book Chapter 2.

At the top of your first page of each Notebook you should include Name, Class, Section, and homework assignment.

The header of your Quarto Notebooks should include

---
title: "Stat. 654 Homework 1"
author: "Your name"
date: "March 24, 2025"
format: 
  html:
    embed-resources: true
---

Submit: Submit four Quarto Notebooks or shared Colab Notebooks. You can share the Colab Notebooks with me by providing the links in Canvas. If you use Quarto Notebooks, you can submit both your .qmd and .html files. If you use Jupyter Notebooks, you can submit both your .ipynb and .html files. To have your work visible in Canvas your Notebooks need to be .html. I will not be running your .qmd or .ipynb files to view your work. - Github: - Deep Learning with R Notebooks - Deep Learning with Python Notebooks