









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










Name:
netid:
Signal Processing and Linear Prediction
s[n] = Gx[n] +
m=
ams[n − m] = h[n] ∗ x[n]
H(z) =
m=1 amz −m
k=1 (1^ −^ pkz
k=
Ck 1 − pkz−^1
n=−∞
e^2 [n] =
n=−∞
s[n] −
∑^ p
m=
ams[n − m]
n=−∞
s[n] −
∑^ p
m=
ams[n − m]
s[n − k], 1 ≤ k ≤ p
~γ = R~a
Image Interpolation
y[n 1 , n 2 ] =
x
[ (^) n 1 U ,^
n 2 U
] (^) n 1 U ,^
n 2 U both integers 0 otherwise
z[n 1 , n 2 ] = h[n 1 ] ∗ 1 (h[n 2 ] ∗ 2 y[n 1 , n 2 ])
hrect[n] =
1 0 ≤ n < U 0 otherwise
, htri[n] =
1 − | Un| −U ≤ n ≤ U 0 otherwise
, hsinc[n] = sin(πn/U ) πn/U
Optical Flow
∂f ∂t
= (∇f )T^ ~v
~v = (AT^ A)−^1 AT~b
Gaussians, GMMS, and Principal Components
p (^) X~ (~x) =
k=
ck
(2π)D/^2 |Σ|^1 /^2
e−^
(^12) (~x−~μk )T (^) Σ− k 1 (~x−~μk )
(n − 1)Σ = V ΛV T^ ,
n − 1
d=
σ d^2 =
n − 1
trace
n − 1
trace
n − 1
d=
λd
f^ ~ [t] = σ(uf ~x[t] + wf~h[t − 1] + bf ), ~i[t] = σ(ui~x[t] + wi~h[t − 1] + bi), ~o[t] = σ(uo~x[t] + wo~h[t − 1] + bo)
~c[t] = f~ [t]~c[t − 1] +~i[t]g
uc~x[t] + wc~h[t − 1] + bc
, ~h[t] = ~o[t]~c[t]
R 0 = E
x^2 [n]
R 1 = E [x[n]x[n − 1]]
Suppose we want to model the signal spectrum as
|X(ω)| ≈
| 1 − ae−jω^ |
where G, R 0 , and R 1 are arbitrary constants. Write a as a function of G, R 0 , and/or R 1.
Solution: We can find the LPC coefficients using
~γ = R~a
where
Rxx[0] · · · Rxx[p − 1] .. .
Rxx[p − 1] · · · Rxx[0]
,^ ~γ^ =
Rxx[1] .. . Rxx[p]
In this case, p = 1, so we have Rxx[1] = Rxx[0]a Therefore a = Rxx[1]/Rxx[0] = R 1 /R 0.
x[n 1 + v 1 , n 2 + v 2 , t] ≈ x[n 1 , n 2 , t] (1)
Find v 1 and v 2 so that the approximation in Eq. (1) is satisfied, for all four pixels of the im- age, with minimum mean-squared error. Your answer can include unresolved matrix multiplica- tions, matrix inversions, determinants and so on, but it should not include any variables other than a, b, c, d, e, f, g, h, i, j, k, l.
Solution: The optical flow equation is
∂x ∂t
∂x ∂n 1
v 1 +
∂x ∂n 2
v 2 (2)
Approximately satisfying Eq. (1) for all four pixels in the image simultaneously would give
a e b f c g d h
v 1 v 2
i j k l
The error in Eq. (1) is minimized by the pseudo-inverse, i.e.,
v 1 v 2
a e b f c g d h
a e b f c g d h
a e b f c g d h
i j k l
ai,j = p(qt = j|qt− 1 = i) αt(i) = p(~x 1 ,... , ~xt, qt = i) βt(i) = p(~xt+1,... , ~xT |qt = i)
Your goal is to identify all of the instants when the heel first touches the ground, i.e., at each time step τ (1 ≤ τ ≤ T ), you want to find
PHS (τ ) = p(qτ − 1 = 4, qτ = 1|~x 1 ,... , ~xT )
Write a formula for PHS (τ ) in terms of αt(i), βt(i), ai,j , and bi(~xt), for any values of i, j, t that you find useful.
Solution: PHS (τ ) =
ατ − 1 (4)a 4 , 1 b 1 (~xτ )βτ (1) ∑ 4 i=
j=1 ατ^ −^1 (i)ai,j^ bj^ (~xτ^ )βτ^ (j)
h( k), is equal to the activation of the same node at the previous layer, plus a computed residual g(ξ k( )):
ξ( k` )=
j=
w( k,j) h( j −1), 1 ≤ k ≤ N,
h( k)= h( k −1)+ g
ξ( k`)
, 1 ≤ k ≤ N,
where g(·) is a scalar nonlinearity, and w( k,j) is a network weight. Suppose that the training loss is L, and suppose you already know dL dh( k)
. Find dL dh( j−1) in terms of dL dh( k) , ˙g(ξ) = ∂g ∂ξ( k) , and w( k,j).
Solution: The total derivative rule gives us
dL dh( j`−1)
k=
dL dh( k`)
∂h () k ∂h( j)
dL dh (`) j
k=
dL dh (`) k
g ˙(ξ k())w( k,j)
ξ[n 1 , n 2 ] = w[n 1 , n 2 ] ∗ x[n 1 , n 2 ],
where ∗ denotes convolution. The output is then max-pooled over the entire image:
ˆy = max 0 ≤n 1 <N 1 max 0 ≤n 2 <N 2 ξ[n 1 , n 2 ]
Suppose the weights and the input image are given by
w[n 1 , n 2 ] =
e−(n
(^21) +n (^22) ) − 3 ≤ n 1 ≤ 3 , − 3 ≤ n 2 ≤ 3 0 otherwise
x[n 1 , n 2 ] =
e−((n^1 −15)
(^2) +(n 2 −12) (^2) ) 0 ≤ n 1 ≤ 63 , 0 ≤ n 2 ≤ 63 0 otherwise
What is (^) dwd[2yˆ,1]? Your answer should be an explicit function of numerical constants; there should not be any variables in your answer.
Solution: dˆy dw[2, 1]
= e−^5
Devise a differentiable non-negative loss function, L, that will approach zero as the estimated values of w, U~ , and V approach their true values. Write your loss as a function of the estimated parameters w, U ~ , and V , and as a function of the vectors in just one data triple, (~x, ~y, ~z).
Solution: First, we want differentiable functions of U and V that will be minimized when ~y = U~x and ~z = V ~x. Most of the functions that do this are norms of the vectors (~y − U~x) and (~z − V ~x), for example, the squared L2 norms, ‖~y − U~x‖^2 and ‖~z − V ~x‖^2 , are good choices. Second, we want to multiply ‖~y − U~x‖^2 by some modifier that goes to zero when w~T^ ~x < 0. The unit step function would do the trick, but it’s not differentiable; we need something that can be differentiated. The ReLU nonlinearity will do the trick:
L = ReLU( w~T^ ~x)‖~y − U~x‖^2 + ReLU(− w~T^ ~x)‖~z − V ~x‖^2
The sigmoid is also a good choice. It doesn’t go to zero immediately when w~T^ ~x < 0, but it goes to zero when w~T^ ~x 0. Since the problem specification doesn’t actually dictate the norm of w~ (it can be any scalar times w~ideal, and still meet the problem specifications), the sigmoid will also work here: L = σ( w~T^ ~x)‖~y − U~x‖^2 + σ(− w~T^ ~x)‖~z − V ~x‖^2
(u, v, w, x, y) = a,
∂v ∂x
(u, v, w, x, y) = b ∂w ∂u (u, v, w, x, y) = c,
∂w ∂v (u, v, w, x, y) = d ∂w ∂x
(u, v, w, x, y) = e,
∂y ∂v
(u, v, w, x, y) = f ∂y ∂w (u, v, w, x, y) = g,
In terms of the constants a, b, c, d, e, f , and g, find ∇ x u
y, the gradient of y with respect to the
vector [x, u]T^.
Solution: The gradient is defined to be
x u
y =
[ (^) ∂y ∂x ∂y (u, x) ∂u (u, x)
i.e., the vector of partial derivatives while keeping constant only the other elements of the same vector. Drawing a flow graph, we find
x
u
v
w
y
In this case we can write the total derivative rule as ∂y ∂x
(u, x) =
dy dv
∂v ∂x
(u, v, w, x, y) +
dy dw
∂w ∂x
(u, v, w, x, y)
∂y ∂v
dy dw
∂w ∂v
∂v ∂x
(u, v, w, x, y) + dy dw
∂w ∂x
(u, v, w, x, y)
= (f + gd)b + ge
Similarly,
∂y ∂u
(u, x) =
dy dw
∂w ∂u
(u, v, w, x, y)
= gc
So ∇ x u
y =
f b + gdb + ge gc
forward : ft = sin(xtwx + ft− 1 wh + b)^2 , backward : bt = sin(xtwx + bt+1wh + b)^2 ,
where the weights are wx = π 4 , wh = π 2 , and b = π 2.
forward : yt = cos
( (^) π 2
( w~xT ~ξt + whyt− 1 + b)
backward : zt = cos
( (^) π 2
( w~xT ~ξt + whzt+1 + b)
where the weights are wx = [2, 1]T^ , wh = 2, and b = 1. Assume that the prior hidden state, before each cell reads its first input, is 0. (a) Consider the input sequence [x 1 , x 2 , x 3 ] = [4, 1 , 7]. What are the forward outputs [f 1 , f 2 , f 3 ] and the backward outputs [b 3 , b 2 , b 1 ] from the first layer?
Solution:
[f 1 , f 2 , f 3 ] = [1,
[b 3 , b 2 , b 1 ] = [