Comp0024 CW3

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

COMP0024 Coursework 3

May 10, 2021

1. (a) i. n = 4

ii.
(x1 ∧ x2 ∧ x3 ) ∨ (x1 ∧ x2 ∧ x3 ) ∨ (x1 ∧ x2 ∧ x3 ) ∨ (x1 ∧ x2 ∧ x3 )

iii.
w11 = −1
w12 = −1
w13 = 1
w21 = −1
w22 = 1
w23 = −1
w31 = 1
w32 = −1
w33 = −1
w41 = 1
w42 = 1
w43 = 1
1
s1 = 4 − −2
2
3
=
2
1
s2 = 4 − −2
2
3
=
2
1
s3 = 4 − −2
2
3
=
2
1
s4 = 4 − −0
2
5
=
2

1
iv. No. A single BDN neuron can compute each of the fundamental logical operations NOT, AND
and OR. Any logical function is built from a combination of these logical operations, which
requires a combination of multiple neurons.

(b) Multiple minima of the Hopfield energy function is valuable because this means we have more stable
states in the system, this gives us more storage space for patterns. Multiple minima of a mean-
square error function is undesirable because this means there are more traps that our algorithm can
get stuck in, which results in more errors.

(c) i.

W12 = −1 + 1 =0
W13 = 1 + (−1) =0
W23 = −1 + (−1) = −2
S1 = −(−1 + 1) =0
S2 = −(1 + 1) = −2
S3 = −(−1 − 1) =2
H(x1 , x2 , x3 ) = −(−2x2 x3 ) − 2x2 + 2x3
= 2x2 x3 − 2x2 + 2x3

ii.

H(0, 0, 0) = 0
H(0, 0, 1) = 2
H(0, 1, 0) = −2
H(1, 0, 0) = 0
H(0, 1, 1) = 2
H(1, 0, 1) = 2
H(1, 1, 0) = −2
H(1, 1, 1) = 2
x1 (t + 1) = h(0, x1 (t))
x2 (t + 1) = h(−2x3 (t) + 2, x2 (t))
x3 (t + 1) = h(−2x2 (t) − 2, x3 (t))

Page 2
(0, 0, 0) →
− (0, 0, 0)

− (0, 1, 0)

− (0, 0, 0)
(0, 1, 0) →
− (0, 1, 0)

− (0, 1, 0)

− (0, 1, 0)
(0, 0, 1) →
− (0, 0, 1)

− (0, 0, 1)

− (0, 0, 0)
(0, 1, 1) →
− (0, 1, 1)

− (0, 1, 1)

− (0, 1, 0)
(1, 0, 0) →
− (1, 0, 0)

− (1, 1, 0)

− (1, 0, 0)
(1, 0, 1) →
− (1, 0, 1)

− (1, 0, 1)

− (1, 0, 0)
(1, 1, 0) →
− (1, 1, 0)

− (1, 1, 0)

− (1, 1, 0)
(1, 1, 1) →
− (1, 1, 1)

− (1, 1, 1)

− (1, 1, 0)

iii. This is a good content addressable memory (CAM). We have neatly divided up the patterns
into 2 identically sized basins of attractions and no additional spurious states were created.

(d) One will be forced to use reinforcement training over supervised learning if the training data pro-
vided is unlabelled. Supervised learning requires training data to have corresponding labels, while
reinforcement learning does not require labelled data. One will prefer to use reinforcement training
if they do not want to impose too many restrictions on how the system should solve the problem. For

Page 3
example, one might prefer to use reinforcement learning in the game of chess instead of supervised
learning as learning from experience more suitable for games.

(e) i. For vector (0,0,0)

||x − w1 || = 0
1 1
||x − w2 || = (3(0 − )2 ) 2
3
= 0.577
2 1
||x − w3 || = (3(0 − )2 ) 2
3
= 1.155
1
||x − w4 || = (3(0 − 1)2 ) 2
= 1.732

Neuron 1 is the winner


For vectors (0,0,1), (1,0,0) and (0,1,0)
1
||x − w1 || = (2(0 − 0)2 + (1 − 0)2 ) 2
=1
1 1 1
||x − w2 || = (2(0 − )2 + (1 − )2
3 3
= 0.816
2 2 1
||x − w3 || = (2(0 − )2 + (1 − )2
3 3
=1
1
||x − w4 || = (2(0 − 1)2 + (1 − 1)2 ) 2
= 1.414

Neuron 2 is the winner


For vectors (1,1,0), (1,0,1), (0,1,1)
1
||x − w1 || = (2(1 − 0)2 + (0 − 0)2 ) 2
= 1.414
1 1 1
||x − w2 || = (2(1 − )2 + (0 − )2
3 3
=1
2 2 1
||x − w3 || = (2(1 − )2 + (0 − )2
3 3
= 0.816
1
||x − w4 || = (2(1 − 0)2 + (0 − 0)2 ) 2
=1

Neuron 3 is the winner

Page 4
For vector (1,1,1)
1
||x − w1 || = (3(1 − 0)2 ) 2
= 1.732
1 1
||x − w2 || = (3(1 − )2 ) 2
3
= 1.155
2 1
||x − w3 || = (3(1 − )2 ) 2
3
= 0.577
1
||x − w4 || = (3(1 − 1)2 ) 2
=0

Neuron 4 is the winner

ii. Patterns that contain more 1s prefer higher numbered neurons. Patterns are mapped so that
the patterns with the same number of 1s are equidistant to each neuron. For example, patterns
(0,1,1) (1,0,1) and (1,1,0) are equidistant to neuron 1.

2. (a)

EU (stayhome) = 2
EU (meetfriend) = 0.8(0.4(10) + 0.4(2) + 0.2(−5)) + 0.2(0.1(10) + 0.6(2) + 0.3(−5))
= 3.18

EU(meetfriend) > EU(stayhome) so we should choose meetfriend

(b) i. This is an axiom for monotonicity. Let [p, α; 1-p, β] be lottery 1 and [q, α; 1-q, β] be lottery
2. If α is strictly preferred over β, then if the value of p ≥ q, then lottery 1 is preferred over
lottery 2. Additionally, if lottery 1 is preferred over lottery 2, then p ≥ q.

ii. This is an axiom for continuity. If α is strictly preferred over β and β is strictly preferred over
γ, there there is a probability where there is an indifference getting β and a lottery that involves
α and γ

iii. This is a lexicographic preference and cannot be represented using a continuous utility function.
((α  β and β  γ)) → − ∃p[p, α; 1 − p, γ] ∼ β
Lexicographic preference is when an agent prefers any amount of a good over another. The
continuity axiom is problematic because some people will never choose a lottery that has a
chance of γ (dying) as an outcome.

(c) Graph G1
complete grounded preferred stable
{} X X
A
B
C X X X

Page 5
Graph G2
complete grounded preferred stable
{} X X
A
B
C
D
B,D X X X
Graph G3
complete grounded preferred stable
{} X X
B
C X X
D
B,D

(d) i. Combined basic probability assignment


m1 ({α}) = 0.5 m1 ({γ}) = 0.5
m2 ({β}) = 0.5 0.25 0.25
m2 ({α, γ}) = 0.5 0.25 0.25

m1 + m2 ({α}) = 0.5
m1 + m2 ({β}) = 0.0
m1 + m2 ({γ}) = 0.5
m1 + m2 ({∅}) = 0.5
m1 + m2 ({α, β}) = 0.0
m1 + m2 ({α, γ}) = 0.0
m1 + m2 ({β, γ}) = 0.0
m1 + m2 ({α, β, γ}) = 0.0

Normalise by dividing each value with 1 − m1 ⊕ m2 ({∅})

m1 ⊕ m2 ({α}) = 0.25/0.50 = 0.50


m1 ⊕ m2 ({β}) = 0.0/0.50 = 0.0
m1 ⊕ m2 ({γ}) = 0.25/0.50 = 0.50
m1 ⊕ m2 ({∅}) = 0.0
m1 ⊕ m2 ({α, β}) = 0.0/0.50 = 0.0
m1 ⊕ m2 ({α, γ}) = 0.0/0.50 = 0.0
m1 ⊕ m2 ({β, γ}) = 0.0/0.50 = 0.0
m1 ⊕ m2 ({α, β, γ}) = 0.0/0.50 = 0.0

Page 6
Belief function

Bel({α}) = 0.5
Bel({β}) = 0.0
Bel({γ}) = 0.5
Bel({α, β}) = 0.5
Bel({α, γ}) = 1.0
Bel({β, γ}) = 0.5
Bel({α, β, γ}) = 1.0

Plausibility function

P l({α}) = 1 − 0.5 = 0.5


P l({β}) = 1 − 1.0 = 0.0
P l({γ}) = 1 − 0.5 = 0.5
P l({α, β}) = 1 − 0.5 = 0.5
P l({α, γ}) = 1 − 0.0 = 1.0
P l({β, γ}) = 1 − 0.5 = 0.5
P l({α, β, γ}) = 1.0

ii. No. Here is a counter example:

m1 ({α} = 0.5
m2 ({α} = 0.5
m1 + m2 ({α} = 0.25
m1 ⊕ m2 ({∅}) = 0.75
m1 ⊕ m2 ({α}) = 0.25/(1 − 0.75)
= 1.0
6= m1 ({α}) or m2 ({α})

Hence, m1 ⊕ m2 ({α}) 6= m1 ({α}) or m2 ({α})

(e) i. No. Since there is no model for 4, then 4 ` ⊥. A counterexample is 4 = {¬p ∨ ¬q, p, q} ` p
where p is not in ∅.
ii. Yes. 4 has no models means that any premise in L is unsatisfiable. Therefore, any formula is
a logical consequence of these premises. An example is {¬p ∨ ¬q, p, q} →
− p, this is a tautology
as the antecedent of the implication always evaluates to false.
iii. Yes. Say α ∈Cn(Cn(4)), this means that Cn(4)  α. This means that every model of Cn(4)
is a model of α. By definition of Cn(4), every model of 4 is a model of Cn(4). Thus, every
model of 4 is a model of α.

Page 7

You might also like