# Campus Section Midterm - Part 3

📗 Enter your ID (the wisc email ID without @wisc.edu) here: and click (or hit enter key)
📗 You can also load from your saved file
and click .
📗 If the questions are not generated correctly, try refresh the page using the button at the top left corner.
📗 The same ID should generate the same set of questions. Your answers are not saved when you close the browser. You could print the page: , solve the problems, then enter all your answers at the end. 
📗 Please do not refresh the page: your answers will not be saved.
📗 Please join Zoom for announcements: Link.

# Warning: please enter your ID before you start!




# Question 1





# Question 2





# Question 3





# Question 4





# Question 5





# Question 6





# Question 7





# Question 8





# Question 9





# Question 10





# Question 11





# Question 12





# Question 13





# Question 14





# Question 15




📗 [4 points] In a simple recurrent neural network with a single hidden recurrent unit and one output unit at the end, suppose all activation functions are LTU (Linear Threshold Unit, or \(g\left(z\right) = 1_{z \geq 0}\)), and the weights are given by \(w^{\left(x\right)}\) = , \(w^{\left(a\right)}\) = , \(w^{\left(y\right)}\) = , \(b^{\left(a\right)}\) = , \(b^{\left(y\right)}\) = . What is the label of a sentence \(\left(x_{1}, x_{2}, ..., x_{T}\right)\) = ?
📗 You can use the activation formulas: \(a_{t} = g\left(w^{\left(x\right)} x_{t} + w^{\left(a\right)} a_{t-1} + b^{\left(a\right)}\right)\) with \(a_{1} = g\left(w^{\left(x\right)} x_{1} + b^{\left(a\right)}\right)\) and \(y = g\left(w^{\left(y\right)} a_{T} + b^{\left(y\right)}\right)\).  
📗 Answer:
📗 [4 points] In a simple recurrent neural network with a single hidden recurrent unit and one output unit at the end, suppose all activation functions are linear (\(g\left(z\right) = z\)), and the current weight is \(w^{\left(x\right)}\) = , \(w^{\left(a\right)}\) = . In one stochastic gradient descent step for some \(\left(x_{i}, y_{i}\right)\), assume \(\dfrac{\partial C}{\partial a_{T}}\) = , \(a_{1} = a_{2} = ... = a_{T} = 1\), and \(x_{i 1} = x_{i 2} = ... = x_{i T} = 1\), where \(T\) is the length of \(x_{i}\). Removing the first input in the sequence \(x_{i}\) will change the gradient \(\dfrac{\partial C}{\partial w^{\left(a\right)}}\) by strictly less than \(0.00001\). What is the smallest possible length \(T\)?
📗 You can use the activation formula: \(a_{t} = g\left(w^{\left(x\right)} x_{t} + w^{\left(a\right)} a_{t-1} + b^{\left(a\right)}\right)\) with \(a_{1} = g\left(w^{\left(x\right)} x_{1} + b^{\left(a\right)}\right)\).
📗 Answer:
📗 [3 points] Which of the following classifier is most preferred as the first classifier in the sequence of classifiers in the Viola-Jones cascade classifier for face detection. Enter the one index (in case of ties, enter the smallest index).
Index Face classified as Face Face classified as Non-face Non-face classified as Face Non-face classified as Non-face
1
2
3
4

📗 Note: the training set for the four classifiers are the same (i.e. each row sum up to \(200\) with the first two columns sum up to \(100\) and the last two columns sum up to \(100\)).
📗 Answer:
📗 [4 points] What is the convolution between the image and the filter using zero padding? Remember to flip the filter first.
📗 Answer (matrix with multiple lines, each line is a comma separated vector): .
📗 [4 points] A convolutional neural network has input image of size x that is connected to a convolutional layer that uses a x filter, zero padding of the image, and a stride of 1. There are activation maps. (Here, zero-padding implies that these activation maps have the same size as the input images.) The convolutional layer is then connected to a pooling layer that uses x max pooling, a stride of (non-overlapping, no padding) of the convolutional layer. The pooling layer is then fully connected to an output layer that contains output units. There are no hidden layers between the pooling layer and the output layer. How many different weights must be learned in this whole network, not including any bias.
📗 Answer: .
📗 [4 points] Suppose the states are integers between and . The initial state is , and the goal state is . The successors of a state \(i\) are \(2 i\) and \(2 i + 1\), if exist. How many states are expanded using a ? Include both the initial and goal states.
📗 Note: use the convention used in the lectures, push the states with larger index into the stack first (i.e. expand the states with the smaller index first).
📗 Answer: .
📗 [2 points] Consider \(n + 1\) = + \(1\) states. The initial state is \(1\), the goal state is \(n\). State \(0\) is a dead-end state with no successors. For each non-\(0\) state \(i\), it has two successors: \(i + 1\) and \(0\). We may expand the same states many times, because we do not keep track of which states are checked previously. How many states (including repeated ones) will be expanded by ? Break ties by expanding the state with the index first.
📗 Note: the tie-breaking rule may be different from the convention used during the lectures, please read the question carefully.
📗 Answer: .
📗 [2 points] Consider a search graph which is a tree, and each internal node has children. The only goal node is at depth (root is depth 0). How many total goal-checks will be performed by in the luckiest case (i.e. the smallest number of goal-checks)? If a node is checked multiple times you should count that multiple times.
📗 Answer:
📗 [2 points] Recall in uniform-cost search, each node has a path-cost from the initial node (sum of edge costs along the path), and the search expands the least path-cost node first. Consider a search graph with \(n\) = nodes: \(1, 2, ..., n\). For all \(1 \leq i < j \leq n\), there is a directed edge from \(i\) to \(j\)  with an edge cost . The initial node is 1, and the goal node is \(n\). How many (unique) goal-checks (the same nodes expanded twice is counted only once) with uniform-cost search perform? Break ties by expanding the node with the smaller index first.
📗 Answer:
📗 [3 points] Suppose the initial state is \(S\) and goal state is \(G\). What is the smallest integer value of the heuristic at state \(1\) such that when A search (A* without the star) is used on the following graph and it does not find the optimal solution. In case of tie, expand the state with a larger index (i.e. \(2\) before \(1\)).
📗 In case the diagram is not clear, the edge costs are

📗 Answer: .
📗 [4 points] Run search algorithm on the following graph, starting from state 0 with the goal state being . Write down the expansion path (in the order of the states expanded). The heuristic function \(h\) is shown as subscripts. Break tie by expanding the state with a smaller index.

📗 In case the diagram is not clear: the weights are (with heuristic values on the diagonal entries): .
📗 Answer (comma separated vector): .
📗 [4 points] Run search algorithm on the following graph, starting from state 0 with the goal state being . Write down the expansion path (in the order of the states expanded). The heuristic function \(h\) is shown as subscripts. Break tie by expanding the state with a smaller index.

📗 In case the diagram is not clear: the weights are (with heuristic values on the diagonal entries): .
📗 Answer (comma separated vector): .
📗 [3 points] Let \(h_{1}\) be an admissible heuristic from a state to the optimal goal, A* search with which ones of the following \(h\) will be admissible? Enter the correct choices as a list, comma separated, without parentheses, for example, "1, 2, 4".
📗 Choices:
(1)
(2)
(3)
(4)
(5)
(6)
(7) None of the above
📗 Answer (comma separated vector): .
📗 [3 points] Given the following two admissible heuristic for A* search, write down another admissible heuristic that (weakly) dominates the two. Write \(\left(h\left(s_{1}\right), h\left(s_{2}\right), h\left(s_{3}\right), h\left(s_{4}\right), h\left(s_{5}\right)\right)\) as a comma separate list. If there are multiple possible values, write one of them, if there are none, write \(-1, -1, -1, -1, -1\).
State \(s_{1}\) \(s_{2}\) \(s_{3}\) \(s_{4}\) \(s_{5}\)
\(h_{1}\)
\(h_{2}\)
\(h\) \(h\left(s_{1}\right)\) \(h\left(s_{2}\right)\) \(h\left(s_{3}\right)\) \(h\left(s_{4}\right)\) \(h\left(s_{5}\right)\)

📗 Answer (comma separated vector): .
📗 [1 points] Please enter any comments including possible mistakes and bugs with the questions or your answers. If you have no comments, please enter "None": do not leave it blank.
📗 Answer: .

# Grade


 * * * *

 * * * * *

# Submission


📗 Please do not modify the content in the above text field: use the "Grade" button to update.


📗 Please wait for the message "Successful submission." to appear after the "Submit" button. Please also save the text in the above text box to a file using the button or copy and paste it into a file yourself and submit it to Canvas Assignment X1. You could submit multiple times (but please do not submit too often): only the latest submission will be counted.
📗 You could load your answers from the text (or txt file) in the text box below using the button . The first two lines should be "##x: 3" and "##id: your id", and the format of the remaining lines should be "##1: your answer to question 1" newline "##2: your answer to question 2", etc. Please make sure that your answers are loaded correctly before submitting them.








Last Updated: January 20, 2025 at 3:12 AM