ML Lecture Notes
ML Lecture Notes
Patient103 time=n
30 Output
Units
4 Hidden
Units
30x32 Sensor
Input Retina
Determine Type
of Training Experience
Determine
Target Function
Determine Representation
of Learned Function
...
Polynomial
Linear function Artificial neural
of six features network
Determine
Learning Algorithm
Linear ...
Gradient programming
descent
Completed Design
Instances X Hypotheses H
Specific
h h
x1 1 3
h
x 2
2
General
x1= <Sunny, Warm, High, Strong, Cool, Same> h 1= <Sunny, ?, ?, Strong, ?, ?>
x = <Sunny, Warm, High, Light, Warm, Same> h = <Sunny, ?, ?, ?, ?, ?>
2 2
h = <Sunny, ?, ?, ?, Cool, ?>
3
Instances X Hypotheses H
-
h0 Specific
x3
h1
h 2,3
x 1+ x+
2
x4+ h General
4
h = <∅, ∅, ∅, ∅, ∅, ∅>
0
x 1 = <Sunny Warm Normal Strong Warm Same>, + h1 = <Sunny Warm Normal Strong Warm Sam
x 2 = <Sunny Warm High Strong Warm Same>, + h2 = <Sunny Warm ? Strong Warm Same>
x 3 = <Rainy Cold High Strong Warm Change>, - h = <Sunny Warm ? Strong Warm Same>
3
x = <Sunny Warm High Strong Cool Change>, + h = <Sunny Warm ? Strong ? ? >
4 4
S: { <Sunny, Warm, ?, Strong, ?, ?> }
<Sunny, ?, ?, Strong, ?, ?> <Sunny, Warm, ?, ?, ?, ?> <?, Warm, ?, Strong, ?, ?>
G 0: {<?, ?, ?, ?, ?, ?>}
S: { <Sunny, Warm, ?, Strong, ?, ?> }
<Sunny, ?, ?, Strong, ?, ?> <Sunny, Warm, ?, ?, ?, ?> <?, Warm, ?, Strong, ?, ?>
<Sunny, ?, ?, Strong, ?, ?> <Sunny, Warm, ?, ?, ?, ?> <?, Warm, ?, Strong, ?, ?>
Inductive bias
made explicit
Outlook
No Yes No Yes
[29+,35-] A1=? [29+,35-] A2=?
t f t f
0.5
t f t f
S: [9+,5-] S: [9+,5-]
E =0.940 E =0.940
Humidity Wind
Outlook
? Yes ?
Ssunny = {D1,D2,D8,D9,D11}
Gain (Ssunny , Temperature) = .970 − (2/5) 0.0 − (2/5) 1.0 − (1/5) 0.0 = .570
Gain (Ssunny , Wind) = .970 − (2/5) 1.0 − (3/5) .918 = .019
+ – +
...
A2
A1
+ – + + + – + –
...
A2 A2
+ – + – + – + –
A3 A4
–
+
... ...
Outlook
No Yes No Yes
0.9
0.85
0.8
0.75
Accuracy
0.7
0.65
0.5
0 10 20 30 40 50 60 70 80 90 100
Size of tree (number of nodes)
0.9
0.85
0.8
0.75
Accuracy
0.7
0.65
0.5
0 10 20 30 40 50 60 70 80 90 100
Size of tree (number of nodes)
Outlook
No Yes No Yes
Sharp Straight Sharp
Left Ahead Right
30 Output
Units
4 Hidden
Units
30x32 Sensor
Input Retina
x1 w1 x0=1
w0
x2 w2
.
. Σ n
Σ wi xi n
xn
. wn i=0
{
o=
1 if Σ wi xi > 0
i=0
-1 otherwise
x2 x2
+
+
- + -
+
x1 x1
- - +
-
(a) (b)
25
20
15
E[w]
10
0
2
1
-2
-1
0 0
1
2
-1 3
w0 w1
head hid who’d hood
... ...
F1 F2
x1 w1 x0 = 1
x2 w2 w0
.
. Σ n
net = Σ wi xi 1
. wn i=0 o = σ(net) = -net
1+e
xn
Inputs Outputs
Inputs Outputs
Sum of squared errors for each output unit
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 500 1000 1500 2000 2500
Hidden unit encoding for input 01000000
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0 500 1000 1500 2000 2500
Weights from inputs to one hidden unit
4
3
2
1
0
-1
-2
-3
-4
-5
0 500 1000 1500 2000 2500
Error versus weight updates (example 1)
0.01
0.009 Training set error
Validation set error
0.008
0.007
Error
0.006
0.005
0.004
0.003
0.002
0 5000 10000 15000 20000
Number of weight updates
0.04
0.03
0.02
0.01
0
0 1000 2000 3000 4000 5000 6000
Number of weight updates
... ...
... ...
y(t + 1) y(t + 1)
y(t + 1)
x(t) c(t)
y(t)
x(t – 1) c(t – 1)
y(t – 1)
x(t – 2) c(t – 2)
(c) Recurrent network
unfolded in time
Binomial distribution for n = 40, p = 0.3
0.14
0.12
0.1
0.08
P(r)
0.06
0.04
0.02
0
0 5 10 15 20 25 30 35 40
Binomial distribution for n = 40, p = 0.3
0.14
0.12
0.1
0.08
P(r)
0.06
0.04
0.02
0
0 5 10 15 20 25 30 35 40
Normal distribution with mean 0, standard deviation 1
0.4
0.35
0.3
0.25
0.2
0.15
0.1
0.05
0
-3 -2 -1 0 1 2 3
0.4
0.35
0.3
0.25
0.2
0.15
0.1
0.05
0
-3 -2 -1 0 1 2 3
P(h ) P(h|D1) P(h|D1, D2)
Prior assumptions
made explicit
y
hML
x
20News
100
90
80
70 Bayes
TFIDF
60 PRTFIDF
50
40
30
20
10
0
100 1000 10000
Storm BusTourGroup
Campfire
Thunder ForestFire
Storm BusTourGroup
Campfire
Thunder ForestFire
p(x)
x
−
−
−
+ +
xq
+ −
+
−
f(x)
w0 w1 wk
1 ...
...
a 1 (x) a2 (x) a n (x)
A stored case: T−junction pipe
Structure: Function:
Q ,T T = temperature
1 1 Q +
Q = waterflow 1
Q
3
Q +
2
Q ,T
3 3
T +
1
T
3
Q ,T T +
2 2 2
Structure: Function:
+
?
C Q +
t + c
+ + Q
m
C + Q
f h −
+
T +
c
T
m
T
h +
Initial strings Crossover Mask Offspring
Single-point crossover:
11101001000 11101010101
11111000000
00001010101 00001001000
Two-point crossover:
11101001000 11001011000
00111110000
00001010101 00101000101
Uniform crossover:
11101001000 10001000100
10011010011
00001010101 01101011001
sin
x +
^ y
x 2
+ +
sin ^ sin
2 + +
x x
x y ^ y
x 2
+ +
sin ^ sin
2 ^ +
x x
x 2 + y
x y
n
e
s
r v u l a i
IF
THEN PlayTennis=yes
IF Wind=weak
THEN PlayTennis=yes
...
IF Wind=strong IF Humidity=high
THEN PlayTennis=no IF Humidity=normal THEN PlayTennis=no
THEN PlayTennis=yes
IF Humidity=normal
Wind=weak
THEN PlayTennis=yes
...
IF Humidity=normal IF Humidity=normal
Wind=strong IF Humidity=normal Outlook=rain
THEN PlayTennis=yes Outlook=sunny THEN PlayTennis=yes
THEN PlayTennis=yes
C : KnowMaterial V Study C : KnowMaterial V Study
2 2
C: PassExam V Study
C: PassExam V Study
Father (Tom, Bob) GrandChild ( y,x ) V Father ( x,z ) V Father ( z,y )
{Bob/y, Tom/z}
{Shannon/x}
Environment
a0 a1 a2
s0 s1 s2 ...
r0 r1 r2
0 0
0
90 100
G 90 100 G
81 0
72 81
81 90 100
81 90
81 90 100
72 81
G
72 100 90 100
R R
63 63
81 81
a right