Answered step by step
Verified Expert Solution
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
Filter (as discussed in class, it captures vertical edges)
Briefly interpret 4.13. Q5(B) Calculate attention weights by Softmax (
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.
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 |
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:
- Copy and paste your answer (a pooled feature map) here:
- Briefly interpret a pooled feature map.
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 |
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 |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started