Consider the neural network shown in the figure with \[ \text{inputs: } u = 2, \, v = 3 \] \[ \text{weights: } a = 1, b = 1, c = 1, d = -1, e = 4, f = -1 \] \[ \text{output: } y \] R denotes the ReLU function, \( R(x) = \max(0, x) \).
Given \( u = 2, v = 3, a = 1, b = 1, c = 1, d = -1, e = 4, f = -1 \), which one of the following is correct?
Consider designing a linear classifier
\[ y = \text{sign}(f(x; w, b)), \quad f(x; w, b) = w^T x + b \]on a dataset \( D = \{(x_1, y_1), (x_2, y_2), \dots, (x_N, y_N)\} \), where \( x_i \in \mathbb{R}^d \), \( y_i \in \{+1, -1\} \), for \( i = 1, 2, \dots, N \).
Recall that the sign function outputs \( +1 \) if the argument is positive, and \( -1 \) if the argument is non-positive. The parameters \( w \) and \( b \) are updated as per the following training algorithm:
\[ w_{\text{new}} = w_{\text{old}} + y_n x_n, \quad b_{\text{new}} = b_{\text{old}} + y_n \]whenever \( \text{sign}(f(x_n; w_{\text{old}}, b_{\text{old}})) \neq y_n \).
In other words, whenever the classifier wrongly predicts a sample \( (x_n, y_n) \) from the dataset, \( w_{\text{old}} \) gets updated to \( w_{\text{new}} \), and likewise \( b_{\text{old}} \) gets updated to \( b_{\text{new}} \).
Consider the case \( (x_n, +1) \), where \( f(x_n; w_{\text{old}}, b_{\text{old}}) < 0 \). Then:
Consider a directed graph \( G = (V,E) \), where \( V = \{0,1,2,\dots,100\} \) and
\[ E = \{(i,j) : 0 < j - i \leq 2, \text{ for all } i,j \in V \}. \] Suppose the adjacency list of each vertex is in decreasing order of vertex number, and depth-first search (DFS) is performed at vertex 0. The number of vertices that will be discovered after vertex 50 is:
Create empty stack S Set x = 0, flag = 0, sum = 0 Push x onto S while (S is not empty){ if (flag equals 0){ Set x = x + 1 Push x onto S } if (x equals 8): Set flag = 1 if (flag equals 1){ x = Pop(S) if (x is odd): Pop(S) Set sum = sum + x } } Output sumThe value of \( sum \) output by a program executing the above pseudocode is:
def f(a, b): if (a == 0): return b if (a % 2 == 1): return 2 * f((a - 1) / 2, b) return b + f(a - 1, b) print(f(15, 10))The value printed by the code snippet is 160 (Answer in integer).
Consider the following tables, Loan and Borrower, of a bank.
Query: \[ \pi_{\text{branch\_name}, \text{customer\_name}} (\text{Loan} \bowtie \text{Borrower}) \div \pi_{\text{branch\_name}}(\text{Loan}) \] where \( \bowtie \) denotes natural join. The number of tuples returned by the above relational algebra query is 1 (Answer in integer).