Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

Q1. (4 points) How Convolution Works Q1(A) For an image (6 by 6) and filter (3 by 3) shown below, generate a feature map by

Q1. (4 points) How Convolution Works Q1(A) For an image (6 by 6) and filter (3 by 3) shown below, generate a feature map by performing a convolution (Stride = 1, Padding = 1, activation function = ReLU) Image
3 0 1 2 7 4
1 5 8 9 3 1
2 7 2 5 1 3
0 1 3 1 7 8
4 2 1 6 2 8
2 4 5 2 3 9
Filter (as discussed in class, it captures vertical edges)
1 0 -1
1 0 -1
1 0 -1
  • To help with the calculation, I have calculated the first cell in the feature map (Q2_conv.xlsx). You can use it for calculating convolution.
  • Copy and paste your answer (a feature map) here:
Q1(B) The next step is Pooling a feature map you obtained from above.
  • Copy and paste your answer (a pooled feature map) here:
  • Briefly interpret a pooled feature map.
Q1(C) To change the dimension of a pooled feature map to (1 x 1), what is the convolution filter you need? Q2. (4 points) Overfitting and Transfer Learning Data: Cats-and-Dogs Program: Q2_cats_and_dogs_cnn.ipynb Q2_cats_and_dogs_transfer_learning.ipynb Q2(A) Run Q2_cats_and_dogs_cnn.ipynb. When you look at the training accuracy and validation accuracy, there is an overfitting problem. Change the model to prevent overfitting as we discussed in class. Briefly explain the changes you have made. Report the validation accuracy and submit your final program. Q2(B) Run Q2_cats_and_dogs_transfer_learning.ipynb. The results clearly show the power of transfer learning and fine-tuning. Interpret the code section Build a Model with Transfer Learning in detail by linking the ideas of transfer learning with the code lines. Q3. (4 points) Text Mining DATA: gas_text_numeric_data (library = DMTXT) PROGRAM: SAS OnDemand EM Text Mining Read Q3_Text Mining.pdf and develop a diagram following the instructions. The data is from the DMTXT library so make sure that you have registered for this course. Q3(A) After step #11 on page 4, you see the descriptive terms for each cluster. Briefly characterize each cluster based on those terms. From a marketing manager's viewpoint, which cluster may guide you in developing a promotional strategy? Q3(B) The case currently shows three models to compare. I want you to add "your" model that may improve the model fit including textual comments. Briefly describe your model and report the model fit. Submit the final SPK file. Q4. (4 points) Object Detection and Semantic Segmentation Q4(A) In Week 4, we learned object detection using bounding boxes. What is the target vector for blue and red bounding boxes? Q4(B) For semantic segmentation, we have discussed the idea of U-Net architecture. Here is a diagram of a U-Net model with 3 layers for encoder and decoder, How do the skip connections in a U-Net model help to improve the segmentation performance? Briefly explain as you understand it. Q5. (4 points) Self-Attention in Transformers PROGRAM: Q5_compute_self_attention.ipynb In Week 7, we learned Transformers, a foundation of all current large language models. A simple program, Q5_compute_self_attention, shows you the step-by-step calculation. Target sentence: I wish peace on earth Q5(A) We first calculate the scaled dot product (5x 5)
Attention Scores (scaled dot product):
I wish peace on earth
I 0.16 0.37 0.59 0.8 1.01
wish 0.37 0.92 1.47 2.02 2.57
peace 0.59 1.47 2.36 3.24 4.13
on 0.8 2.02 3.24 4.47 5.69
earth 1.01 2.57 4.13 5.69 7.24
Briefly interpret 4.13. Q5(B) Calculate attention weights by Softmax (
Attention Weights:
I wish peace on earth
I 0.12 0.15 0.19 0.24 0.29
wish 0.05 0.09 0.15 0.26 0.45
peace 0.02 0.04 0.1 0.25 0.59
on 0.01 0.02 0.06 0.21 0.71
earth 0 0.01 0.04 0.17 0.79
Briefly interpret 0.59. Q6. (2 points) Hugging Face Space I want you to be able to showcase your projects in Hugging Face Spaces using a friendly web interface called Gradio. Spaces are a simple, free way to host your ML demo apps in Python. You can create a repository at https://huggingface.co/new-space and select Gradio as the SDK. Once done, you can create a file called app.py, upload the file, and your app will be up and running in a minute (please watch the animation below). Step 1: Log in to Hugging Face Step 2: Click your account icon (top right corner) and select New Space Step 3: Type a space name (e.g., BigGAN) It is one of the text-to-image generation models / Leave License empty / Select Gradio / Default free hardware / Select Select Private ? Create Space Step 4: You will see (Hint: Create the app.py file right in your browser alternatively). Click Create. Step 5: Copy and paste the following codes in a box: import gradio as gr description = "BigGAN text-to-image demo." title = "BigGAN ImageNet" interface = gr.Interface.load("huggingface/osanseviero/BigGAN-deep-128", description=description, title = title, examples=[["american robin"],["golden retriever"], ], ) / Leave everything else as is / At the bottom, Click Commit New File to Main. You can see that it is building your space. Step 6: Once built, you can click on the name of the space (your username/space name). Step 7: You can check the example or type, for example, lion or tiger. It is limited since it will generate only for the objects trained in ImageNet. But it's a start. Q6 Submit the screenshot of your space that shows BigGAN.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students explore these related Programming questions