DLAI4 Example Solutions
DLAI4 Example Solutions
[SEEN SIMILAR]
[3 marks]
(b) The generalisation error of d is:
E(X1 ,X2 ),Y Loss Y, Ŷ ) = E(X1 ,X2 ),Y (c (Y, d(X1 , X2 ))) (2)
NB: it is fine not to write this out as an integral, but an answer written as an
integral is also acceptable. [SEEN]
[3 marks]
1 of 7 2024
MATH4267 Solutions JL
(c) The generalisation error for a zero-one loss is minimised for the function
(
1 if P (Y = 1|X1 , X2 = (x1 , x2 )) > P (Y = 0|X1 , X2 = (x1 , x2 ))
dmin (x1 , x2 ) =
0 otherwise
Since we have
fX1 ,X2 |Y =1 (x1 , x2 )P (Y = 1)
P (Y = 1|X1 , X2 = (x1 , x2 )) =
fX1 ,X2 (x1 , x2 )
αfX1 ,X2 |Y =1 (x1 , x2 )
=
fX1 ,X2 (x1 , x2 )
fX ,X |Y =0 (x1 , x2 )P (Y = 0)
P (Y = 0|X1 , X2 = (x1 , x2 )) = 1 2
fX1 ,X2 (x1 , x2 )
(1 − α)fX1 ,X2 |Y =0 (x1 , x2 )
=
fX1 ,X2 (x1 , x2 )
[SEEN SIMILAR]
[4 marks]
NB: it is fine to use abbreviations of previously defined functions, rather than
writing them out in full each time.
2 of 7 2024
MATH4267 Solutions JL
3 of 7 2024
MATH4267 Solutions JL
3. (a) We have
= H(X) − H(Y )
Since H(X|Y ) − H(Y |X) = H(X) − H(Y ), we have H(X|Y ) = H(Y |X) if and
only if H(X) = H(Y ). [SEEN]
[3 marks]
(b) The K-L divergence of random variables X and Y (where defined) is defined as
Z
fX (x)
DKL (fX , fY ) = fX (x) ln dx
fY (x)
where fX (x) and fY (x) are the PDFs of X and Y , and the integral is over the
domain of fX and fY .
To show that the K-L divergence is non-negative, we use Jensen’s inequality:
since ln(x) is concave, we have, for positive-valued functions p(x), q(x):
Z Z
p(x) ln(q(x))dx ≤ ln p(x)q(x)dx
4 of 7 2024
MATH4267 Solutions JL
so
Z
fY (x)
DKL (fX ||fY ) = − fX (x) ln dx
fX (x)
Z Z
fY (x)
≥ ln fX (x) dx ln fY (x)dx
fX (x)
= ln(1) = 0
Z Z
=− fY (x)dx + fX (x)dx
= −1 + 1 = 0
[SEEN]
[5 marks]
5 of 7 2024
MATH4267 Solutions JL
(c) We have
as required. [UNSEEN]
[7 marks]
6 of 7 2024
MATH4267 Solutions JL
4. (a) We have hi = ϕ(W hi−1 + U Xi + b). The value of W affects hi both directly
through this equation, and through hi−1 . Thus we have for i > 1:
dhi ∂hi ∂hi dhi−1
αi = = +
dW ∂W ∂hi−1 dW
= βi + γi αi−1
[SEEN SIMILAR]
[4 marks]
(b) If n = 2 then we have
2−1 2
!
X Y
α2 = β2 + γ2 α1 = β2 + γj βi
i=1 j=1+1
Suppose by induction that the formula in the question holds for n = 1, 2 . . . n−1.
Then we have
αn = βn + γn αn−1
n−2 n−1
! !
X Y
= βn + γn βn−1 + γj βi
i=1 j=i+1
n−2 n−1
!
X Y
= βn + γn βn−1 + γn γj βi
i=1 j=i+1
n−1 n
! n−2 n
!
X Y X Y
= βn + γj βi + γj βi
i=n−1 j=i+1 i=1 j=1+1
n−1 n
!
X Y
= βn + γj βi
i=1 j=1+1
[SEEN SIMILAR]
[4 marks]
7 of 7 2024