CSCE 636-600 Deep Learning
CSCE 636-600 Deep Learning
Instructor: Prof. Anxiao (Andrew) Jiang. Email: ajiang@cse.tamu.edu
Time and Location: 1/13/2025 to 5/6/2025, 3:55--5:10pm on Tuesdays and Thursdays, in 124 HRBB
TAs: Jeff Hykin (email: jeff.hykin+cs636@tamu.edu ) and Liudeng Wang (email: eureka@tamu.edu )
Office Hours:
Dr. Jiang's office hour: 11:00am--11:30am on Mondays, via Zoom at https://us04web.zoom.us/j/76827536251?pwd=m1GTxGUA7JrTSVwfkLP9fLTelI9dEM.1
(Meeting ID: 768 2753 6251, Passcode: 4qjnyu)
Liudeng Wang's office hours: 1:30-2:30pm on Tuesdays and 1:30-2:30pm on Wednesdays, via zoom at https://tamu.zoom.us/j/6557063576 (Meeting ID: 655 706 3576)
Jeff Hykin's office hours: 5:10 - 6:10pm on Thursdays and 4:00-5:00pm on Fridays, via zoom at https://tamu.zoom.us/j/9726131094
Grading and Requirements:
The final grade is based on homework and project. Homework: 25%. Three projects: 25% per project (75% total).
Submission Policy: An electronic copy of each homework should be submitted in https://canvas.tamu.edu. An electronic copy of each file for Projects should be emailed to moore.research.education@gmail.com. No late homework/project submission will be accepted. Students should double check each submission to make sure correct files are submitted. (If wrong files are submitted, correct files to replace them can only be submitted before the deadline, not after it.)
By default, all work is solo; no collaboration allowed unless stated otherwise.
Textbook:
Textbook: Deep Learning with Python, 2nd Edtion, by Francois Chollet.
Recommended Textbook: Deep Learning: Foundations and Concepts, 2024 edition, by Christopher M. Bishop and Hugh Bishop.
Computing resources:
1. Google CoLab: an open and free Jupyter notebook environment by Google that runs in the cloud and allows us to use CPU, GPU and TPU resources. It requires no setup. It's a good resource for anyone who wants to do swift experiments in deep learning.
2. HPRC: You can apply for an account at TAMU HPRC (High Performance Research Computing). It has CPU and GPU resources.
1/14/2025 (Tuesday): Lecture 1: What is Deep Learning.
1/16/2025 (Thursday): Lecture 2: Mathematical Building Blocks of Neural Networks.
1/21/2025 (Tuesday): Class cancelled due to weather
1/23/2025 (Thursday): Lecture 2: Mathematical Building Blocks of Neural Networks.
1/28/2025 (Tuesday): Lecture 3: Getting Started with Neural Networks: Classification and Regression.
1/30/2025 (Thursday): Lecture 3: Getting Started with Neural Networks: Classification and Regression.
2/4/2025 (Tuesday): Lecture 4: Fundamentals of Machine Learning. Lecture 5: Working with Keras: A Deep Dive.
2/6/2025 (Thursday): Lecture 6: Introduction to Deep Learning for Computer Vision.
2/11/2025 (Tuesday): Self-study.
2/13/2025 (Thursday): Lecture 6: Introduction to Deep Learning for Computer Vision.
2/18/2025 (Tuesday): Lecture 7: Advanced Deep Learning for Computer Vision.
2/20/2025 (Thursday): Lecture 8: Deep Learning for Time Series.
2/25/2025 (Tuesday): Lecture 8: Deep Learning for Time Series. Lecture 9: Deep Learning for Text.
2/27/2025 (Thursday): Lecture 9: Deep Learning for Text.
3/4/2025 (Tuesday): Lecture 9: Deep Learning for Text.
3/6/2025 (Thursday): Lecture 9: Deep Learning for Text.
3/11/2025 (Tuesday): Spring break. No class.
3/13/2025 (Thursday): Spring break. No class.
3/18/2025 (Tuesday): Lecture 9: Deep Learning for Text. Discuss Project 1.
3/20/2025 (Thursday): Discuss Project 1. Supplementary Lectures on Linear Programming. (Lecture videos: Part 1 of 4)
3/25/2025 (Tuesday): Discuss Project 1. Supplementary Lectures on Linear Programming. (Lecture videos: Part 2 of 4, Part 3 of 4, Part 4 of 4)
3/27/2025 (Thursday): Lecture 10: Generative Deep Learning.
4/1/2025 (Tuesday): Lecture 10: Generative Deep Learning.
4/3/2025 (Thursday): Lecture 11: Best Practices for the Real World.
4/8/2025 (Tuesday): Q&A Session for Project 1, via zoom at 3:55--5:10pm. (The zoom link is the same as that for Prof. Jiang's office hour on Mondays, shown at the top of this webpage.) No in-class meeting.
4/10/2025 (Thursday): Lecture 12: Deep Reinforcement Learning (Slides and Lecture Video Part 1 of 3)
4/15/2025 (Tuesday): Lecture 12: Deep Reinforcement Learning (Slides and Lecture Video Part 1 of 3)
4/17/2025 (Thursday): Lecture 12: Deep Reinforcement Learning (Slides and Lecture Video Part 2 of 3)
4/22/2025 (Tuesday): Lecture 12: Deep Reinforcement Learning (Slides and Lecture Video Part 3 of 3)
4/24/2025 (Thursday): Lecture 13: Deep Reinforcement Learning: Q Learning (Slides and Lecture Video)
4/29/2025 (Tuesday): Redefined day(as Friday). No class.
Some Legacy Lecture Slides and Videos: What is Deep Learning (See Lecture 1 video and slides. Read Chapter 1 of textbook.) The Mathematical Building Blocks of Deep Learning (See Lecture 2 video for Part 1, video for Part 2 and slides. Read Chapter 2 of textbook.) Introduction to Keras and TensorFlow (See Lecture 3 video and slides. Read Chapter 3 of textbook.) Getting Started with Neural Networks: Classification and Regression (See Lecture 4 video for Part 1, video for Part 2, video for Part 3 and slides. Read Chapter 4 of textbook.) Fundamentals of Machine Learning (See Lecture 5 video and slides. Read Chapter 5 of textbook.) Working with Keras: A Deep Dive (See Lecture 6 video for Part 1, video for Part 2, video for Part 3 and slides. Read Chapter 6 and 7 of textbook.) Introduction to Deep Learning for Computer Vision (See Lecture 7 video for Part 1, video for Part 2, video for Part 3 and slides. Read Chapter 8 of textbook.) Advanced Deep Learning for Computer Vision (See Lecture 8 video for Part 1, video for Part 2 and slides. Read Chapter 9 of textbook.) Advanced Deep Learning for Computer Vision (See Lecture 8 video for Part 3, video for Part 4, video for Part 5 and slides. Read Chapter 9 of textbook.) Deep Learning for Timeseries (See Lecture 9 video for Part 1 and slides. Read Chapter 10 of textbook.) Deep Learning for Timeseries (See Lecture 9 video for Part 2, video for Part 3 and slides. Read Chapter 10 of textbook.) Deep Learning for Text (See Lecture 10 video for Part 1 and slides. Read Chapter 11 of textbook.) Deep Learning for Text (See Lecture 10 video for Part 2 , video for Part 3, video for Part 4 and slides. Read Chapter 11 of textbook.) Deep Learning for Text (See Lecture 10 video for Part 5, video for Part 6, video for Part 7 and slides. Read Chapter 11 of textbook.) Generative Deep Learning (See Lecture video on auto-encoder. Read Chapter 12 of textbook.) Generative Deep Learning (See Lecture video on VAE and GAN. Read Chapter 12 of textbook.) Generative Deep Learning (See Lecture video on GAN. Read Chapter 12 of textbook.) Generative Deep Learning (See Lecture video on GAN. Read Chapter 12 of textbook.) Best Practices for the Real World (See Lecture video on tuning hyperparameters. Read Chapter 13 of textbook.) Transfer Learning (See Lecture video on transfer learning) Transfer Learning (See Lecture video on transfer learning) Ensemble Learning (See Lecture video on ensemble learning, Part 1 of 3) Ensemble Learning (See Lecture video on ensemble learning, Part 2 of 3) Ensemble Learning (See Lecture video on ensemble learning, Part 3 of 3)
Updated Lecture Slides:
Homework one. Due: 11:59pm (Central Time) on Thursday 1/30/2025 in Canvas.
Check out the Jupyter notebook for Chapter 2 at https://github.com/fchollet/deep-learning-with-python-notebooks/blob/master/chapter02_mathematical-building-blocks.ipynb. Then:
1) For the neural network in the Jupiter notebook for the MNIST task (which has 2 layers, where the first layer has 512 neurons and the second layer has 10 neurons), adjust the size of the first layer (namely, the number of neurons in the first layer) as: 16, 32, 64, 128, 256, 512. For each size, train the neural network and record its test accuracy (namely, accuracy on the test set). Draw a figure, where the x-axis is the size of the first layer, and the y-axis is the test accuracy. Submit your figure.
2) For the neural network in the Jupiter notebook for the MNIST task (which has 2 layers, where the first layer has 512 neurons and the second layer has 10 neurons), adjust the number of layers to be: 2, 3, 4, 5. (The last layer has to have size 10 since we have 10 classes. But you can decide on the sizes of the other layers.) For each case, train the neural network and record its test accuracy. Draw a figure, where the x-axis is the number of layers, and the y-axis is the test accuracy. Submit your figure, and specify the sizes of your layers for each case.
Homework two. Due: 11:59pm (Central Time) on Thursday 2/6/2025 in Canvas.
1) Check out the Jupyter notebook for Chapter 3 at https://github.com/fchollet/deep-learning-with-python-notebooks/blob/master/chapter03_introduction-to-keras-and-tf.ipynb. Then, use the "GraidentTape API" to find the derivative of the function f(x) = sin(x) for x = 0, 0.1, 0.2 and 0.3. Submit your Jupyter notebook that shows both the code and the result you got.
2) Check out the Jupyter notebook for Chapter 4 at https://github.com/fchollet/deep-learning-with-python-notebooks/blob/master/chapter04_getting-started-with-neural-networks.ipynb. Then, for the task "Classifying movie reviews: A binary classification example", tune the hyper-parameters of the model (such as changing the number of layers, changing the sizes of layers, changing the optimizer, changing the learning rate, etc.), and see if you can improve the model's performance. Submit a Jupyter notebook where you clearly show the code with the best hyper-parameters that you have found, along with its performance on training, validation and test sets.
Homework three. Due: 11:59pm (Central Time) on Tuesday 2/20/2025 in Canvas. (Submit all answers below in a single Jupyter notebook file.)
1) Check out the Jupyter notebook for Chapter 5 at https://github.com/fchollet/deep-learning-with-python-notebooks/blob/master/chapter05_fundamentals-of-ml.ipynb . Answer the question: what regularization techniques were mentioned in that Jupyter notebook?
2) The MNIST dataset has 60,000 training images and 10,000 test images. Each image is a 28x28 array, where each array element is between 0 and 255. The images have 10 labels: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.
We now create a new dataset of about 30,000 training images, about 5,000 test images and 5 labels (which are 0, 1, 2, 3, 4) as follows. First, randomly pair up the training images of label 0 with the training images of label 1, to get about 6,000 such pairs. (The actual number may be a little less than 6,000, because the number of images for some label may be less than -- although close to -- 6,000. In this case, just get as many pairs as you can.) Then, for each pair (A,B) where A is an image of label 0 and B is an image of label 1, we create a new image of size 28x28, where each element's value is the "average" of the two corresponding pixel values in A and B. (So the new image is a "mixture" of the two original images.) This way we create about 6,000 new "mixture" images for training. In a similar way, we create about 1,000 new "mixture" images for testing. We give all these about 6,000+1,000=7,000 new "mixture" images the new label 0. Then, in the same way, we create about 6,000 new training images and about 1,000 new test images by mixing the original images of label "2" and "3", and give them the new label 1; create about 6,000 new training images and about 1,000 new test images by mixing the original images of label "4" and "5", and give them the new label 2; create about 6,000 new training images and about 1,000 new test images by mixing the original images of label "6" and "7", and give them the new label 3; create about 6,000 new training images and about 1,000 new test images by mixing the original images of label "8" and "9", and give them the new label 4.
Your task: submit your code that creates the above new dataset; then for each of the 5 new labels, randomly select 2 images of that label from your new dataset, and display them in your submitted Jupyter notebook.
3) Design a neural network model to classify the 5 classes in the new dataset, and optimize it by tuning its hyper-parameters and trying our learned regualization techniques (such as L1 regularization, L2 regularization, dropout).
Your task: For your final (namely, optimized) neural network model, submit its code, and show the model's performance (including loss value and accuracy) for training, validation and testing. (For training performance and validation performance, illustrate them using figures, where the x-axis is the number of training epochs, and the y-axis is the loss or accuracy. For testing performance, just show the values of loss and accuracy.) Also, answer the questions: in this process of optimizing your model, did you observe underfitting? Did you observe overfitting? Did you try the reguliazation techniques? Did they help?
Homework four. Due: 11:59pm (Central Time) on Thursday 3/6/2025 in Canvas. (Submit all answers below in a single Jupyter notebook file.)
1) Check out the Jupyter notebook for Chapter 8 at https://github.com/fchollet/deep-learning-with-python-notebooks/blob/master/chapter08_intro-to-dl-for-computer-vision.ipynb. It uses the convolutional base of VGG16 for an image classification task, and also tries fine tuning. Your task: use another existing trained neural network (which is different from VGG16, such as ResNet) for the same task, and also try fine tuning. Submit your complete code, draw figures on the training/validation performance, and show the testing performance.
Homework five. Due: 11:59pm (Central Time) on Thursday 3/20/2025 in Canvas. (Submit all answers below in a single Jupyter notebook file.)
Check out the Jupyter notebooks for Chapter 9 at https://github.com/fchollet/deep-learning-with-python-notebooks/blob/master/chapter09_part01_image-segmentation.ipynb, https://github.com/fchollet/deep-learning-with-python-notebooks/blob/master/chapter09_part02_modern-convnet-architecture-patterns.ipynb, and https://github.com/fchollet/deep-learning-with-python-notebooks/blob/master/chapter09_part03_interpreting-what-convnets-learn.ipynb. Then:
1) Try the code on image segmentation. Show the segmentation result on a randomly selected image.
2) Try the code on "Visualizing intermediate activations". Show the visualization result on a randomly selected image from the cats-and-dogs dataset.
3) Try the code on "Visualizing convnet filters". Show the visualization result for a randomly selected filter.
4) Try the code on "Visualizing heatmaps of class activation". Show the visualization result on a randomly selected image from the cats-and-dogs dataset.
Homework six. Due: 11:59pm (Central Time) on Thursday 3/27/2025 in Canvas. (Submit all answers below in a single Jupyter notebook file.)
Check out the Jupyter notebook for Chapter 10 at https://github.com/fchollet/deep-learning-with-python-notebooks/blob/master/chapter10_dl-for-timeseries.ipynb. It has tried 7 methods for the temperature prediction problem: Try 1 (A common-sense, non-machine learning baseline method), Try 2 (A fully connected neural network), Try 3 (1-d convolutional neural networks), Try 4 (Recurrent neural network), Try 5 (LSTM with recurrent dropout), Try 6 (stacking RNN layers), Try 7 (Bidirectional RNN).
Your task: use the above 7 methods to predict the temperature in 48 hours (instead of 24 hours). In the Jupyter notebook, include your code as well as the performance of the 7 methods.
Project 1. Due: 11:59pm (Central Time) on Tuesday 4/8/2025 by email. (Please email your train DNNs and Jupyter notebook to our project email address moore.research.education@gmail.com. The title of the email should be "CSCE 636-600 Spring 2025 Project 1 + {YOUR NAME} + {YOUR UIN}".)
Project 2: Same as Project 1. Students are encouraged to explore new methods to further improve the results. Due: 11:59pm (Central Time) on Friday 4/18/2025 by email. (Please email your train DNNs and Jupyter notebook to our project email address moore.research.education@gmail.com. The title of the email should be "CSCE 636-600 Spring 2025 Project 2 + {YOUR NAME} + {YOUR UIN}".)
Project 3: Same as Project 1. Students are encouraged to explore new methods to further improve the results. Due: 11:59pm (Central Time) on Monday 4/28/2025 by email. (Please email your train DNNs and Jupyter notebook to our project email address moore.research.education@gmail.com. The title of the email should be "CSCE 636-600 Spring 2025 Project 3 + {YOUR NAME} + {YOUR UIN}".)
Project 1, 2 and 3 Test Results. Due: 11:59pm (Central Time) on Friday 5/2/2025 in Canvas. (Submit all your testing results in one file.)
To ensure correct grading of your models for Project 1, 2, and 3, a test set has been posted here on Wednesday 4/30/2025. Please use your models for Project 1, 2 and 3, respectively, on the posted test set to get the corresponding predict m-heights, and submit them as a single file in Canvas. (The posted test set is a part of the test set used to evaluate your models. Your submitted results --- namely, the m-heights predicted by your models for Project 1, 2 and 3, respectively -- will be compared to our testing results on your models for verification.)
The test set posted above is a list of N samples, where each sample is a list [n,k,m,P], where n is an integer in {9, 10}, k is an integer in {4, 5, 6}, m is an integer in {2, 3, ...,, n-k}, and P is a 2-dimensional numpy array (not a tensor) of k rows and n-k columns. (The list is saved using pickle.dump(). You can open it using pickle.load().) You should run your models for Project 1, Project 2 and Project 3, respectively, on the N samples, to get 3 lists of N corresponding m-heights. For t=1,2,3, let H_t denote the list of N m-heights predicted by your model for Project t, then for r=0,1,...,N-1, the r-th real number in the list H_t --- namely, the real number H_t[r] --- is the m-height predicted for the r-th sample by your model for Project t.
What to submit: put your three lists H_1, H_2 and H_3 into a single dictionary in Python. The dictionary has 3 string-valued keys: 'project_1', 'project_2' and 'project_3'. The value for the key 'project_1' is H_1; the value for the key 'project_2' is H_2, and the value for the key 'project_3' is H_3. Save the dictionary as a file using pickle.dump(). The name of the file should be "CSCE 636-600 Spring 2025 Project Test Results + {YOUR NAME} + {YOUR UIN}".
When and where to submit: submit the above file in Canvas by Friday 5/2/2025. (Note: projects without this file will not be graded.)
Statement: The Americans with Disabilities Act (ADA) is a federal anti-discrimination statute that provides comprehensive civil rights protection for persons with disabilities. Among other things, this legislation requires that all students with disabilities be guaranteed a learning environment that provides for reasonable accommodation of their disabilities. If you believe you have a disability requiring an accommodation, please contact Disability Services, currently located in the Disability Services building at the Student Services at White Creek complex on west campus or call 979-845-1637. For additional information, visit http://disability.tamu.edu.
“An Aggie does not lie, cheat or steal, or to tolerate those who do.” See http://aggiehonor.tamu.edu