Assignments
Final: (due Friday May 15, 2026)
This is a take-home Final Exam. You may ask questions of the Professor or search Google or chat with an AI. 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, use the R package keras3, 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:
Run all of the code from the Posit Keras3 website Example Image segmentation with a U-Net-like architecture and explain each step presented. Clearly describe what kind of neural network is being fitted.
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 Keras3 website Example English-to-Spanish translation with a sequence-to-sequence Transformer and explain each step presented. Clearly describe what kind of neural network is being fitted.
OR
Part 3: Alternative If you do not want to do the Timeseries classification from scratch example, you can do the following:
- Download ollama and run ollama run llama3.2:1b.
ollama pull ollama run llama3.2:1b
Install the R packages ollamar and [ellmer]https://opensource.posit.co/software/ellmer/).
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
---
- Read: Chapter 10 Time Series and 12 Generative Deep Learning
- Read: Chapter 13 and 14.
Problems:
- Run as much of the code as you can on your computer from Chapter 10. In 3rd Edition code see Chapter 13 time series code.
- Run as much of the code as you can on your computer from Chapter 12. In 3rd Edition code see Chapter 11 object segmentation, Chapter 12 object detection, Chapter 17 image generation code.
Homework05: (complete by Monday May 4, 2026)
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 6, 2026"
format:
html:
embed-resources: true
---
- Read: Chapter 11 Deep Learning for Text
Problems:
- Run as much of the code as you can on your computer from Chapter 11. In 3rd Edition code see Chapter 14, Chapter 15 and Chapter 16 code.
Project: (due Friday May 8, 2026) Updated May 1, 2026
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. (The code has now been updated to use keras3.)
Next get the code from Chapter 12 Section 3, Neural Style Transfer, to run. R code Project.zip Python code Neural style transfer DeepDream
- Step 1: Find the picture to apply the style transfer to.
- Step 2: Replace the sf.jpg image with your own image. Test the code using a smaller number of iterations, change iterations = 4000 to iterations = 200 to start experimenting with the code. (This change has already been made.)
- Research the algorithm used. Who created it? How is the neural network implemented in Keras?
- Explain what the following text-to-image Generative AI products do.
- Test out. Log into your OpenAI account and create image using a text prompt. OpenAI’s image generation is done using Dall-e3 or try out Microsoft 365 or try Google Gemini Nano Banana
- Example Style Transfer:
Midterm: (due Friday May 1, 2026)
Instructions: This is a take-home midterm. Your work is to be completed individually. You may use your book, Google, AI, 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.
- Name the three Godfathers of AI.
- When using the Gradient Descent Algorithm and Backpropogation, in which direction do updates move?
- Explain what a Convolutional Neural Network is in words. How does a convnet compare to the traditional feedforward neural network?
- 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, report the accuracy, then try adding dropout layer(s) to see if the fit can be improved, report the accuracy. Explain each chunk of code in your Notebook and explain results of your code.
- 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 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.
- 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. Make a table at the top of your Notebook giving the model and the final accuracy.
Question 4:
- R Project: Midterm.zip
- Spotlight Arxiv Paper: EMNIST: an extension of MNIST to handwritten letters
Homework04: (complete by Monday April 27, 2026)
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 27, 2026"
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:
- What GPU do you have in your computer?
- Run the code in Chapter 8.
- Convnets MNIST
- Convnets Dogs vs Cats
Quiz: (due Friday April 24, 2026)
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. index.txt
Using the numeric columns in the dataset build a classification model for the label variable. Add a dropout layer using a rate of .4 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 .4 dropout rate.
Submit: Submit your Quarto Notebook or shared Colab Notebook. You can share the Colab Notebook with me by providing a .docx file containing the Active link in Canvas. If you use Quarto Notebook, you can submit both your .qmd and .html files. I will not be running your .qmd or .ipynb files to view your work.
- Template Quarto Notebook:
Homework03: (complete by Monday April 13, 2026)
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 13, 2026"
toc: true
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.
- Template Quarto Notebooks:
- Read: Chapter 5 and Chapter 6
- Problems:
- Watch the YouTube video series 3Blue1Brown Neural Networks
- You can download the code for the book from this Deep Learning with R Notebooks, Second Edition. Use the most recent code that is in the /code folder.
- Run the code in Chapter 5 related to the mnist data. Split the code into three Quarto Notebooks. Give a descriptive title to each Notebook. Copy the code into separate code chunks and explain what the code is doing directly above each code chunk.
Homework02: (complete by Monday April 6, 2026)
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 6, 2026"
toc: true
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.
- Template Quarto Notebooks:
- Read: Chapter 3 and Chapter 4
- Problems:
- You can download the code for the book from this Deep Learning with R Notebooks, Second Edition. Use the most recent code that is in the /code folder.
- Make three separate Quarto Notebooks or shared Colab Notebooks for the three examples from Chapter 4.
- Watch the videos on YouTube: 3Blue1Brown Neural Networks
Homework01: (complete by Monday March 23, 2026)
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 23, 2026"
toc: true
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:
- Template Quarto Notebooks:
- Read: Chapter 1 and Chapter 2
- Install R and RStudio, if you do not have them installed.
- Install the R package keras3 (for use with a CPU).
- Install R and RStudio, if you do not have them installed.
- Canvas Announcement:
When installing the R package keras3, you can use this website as a reference.
https://keras3.posit.co to an external site.
Please note that there should be only three steps
Install the package keras3
load the library, library(keras3)
Run this command to install the python virtual environment, install_keras(backend = “tensorflow”)
You should only run the install_keras() function one time. Do not put this command into an R code chunk in an R Quarto Notebook. This will likely cause problem because it will reinstall everything every time you Render the Notebook. You should run this command only once in the R Console.
- Problems:
- Run the cars Example.
- Run the concrete Example.
- Run the iris Example.
- Run the code in Chapter 2 related to the mnist data. You can download the code for the book from this Deep Learning with R Notebooks, Second Edition. Use the most recent code that is in the /code folder, chapter02_mathematical-building-blocks.R. Copy the code into separate code chunks and explain what the code is doing directly above each code chunk. Do not include the other code that is not related to the mnist data.