Você está na página 1de 112

EE-214/2011

Agrupamento e
Classificação
de Padrões
EE-214/2011
EE-214/2011

Agrupamento:
Característica = Número de Vértices

0 vértices 4 vértices
EE-214/2011
EE-214/2011

Agrupamento:
Característica = Cor (Comprimento de Onda)

 = 470 nm  = 550 nm
EE-214/2011
EE-214/2011

Agrupamento:
Característica = Área

A > 3 cm2 A  3 cm2


EE-214/2011

Classificação

0 vértices 4 vértices
EE-214/2011

Classificação

0 vértices 4 vértices
EE-214/2011

Classificação

0 vértices 4 vértices
EE-214/2011

Classificação

0 vértices 4 vértices
EE-214/2011

Classificação

0 vértices 4 vértices
EE-214/2011

0 vértices 4 vértices
EE-214/2011

Reconhecimento de Padrões

Círculo
EE-214/2011

Reconhecimento de Padrões

Quadrado
EE-214/2011

Reconhecimento de Padrões

Uh?
EE-214/2011

Ventilador acionado por Motor DC

MOT ,
TAC

J,B

V

I mot
A

BAT
EE-214/2011

Ventilador acionado por Motor DC


R Bat Ia R a

Ea J , B
MOT ,
TAC V V
Bat
   
 
J,B

V

d
I mot J  B 2     B 2
A dt
V  Ea
  I mot    Bat
R Bat  R a
E a   
VBat   
V  Ea   
I mot  Bat R Bat  R a
R Bat  R a
   2
BAT  VBat  
R Bat  R a R Bat  R a
EE-214/2011

Ventilador acionado por Motor DC


R Bat Ia R a

Ea J , B

V V
Bat
   
 
  kImot

   B 2
VBat
R Bat  R a V  Ea
   Bat
  2 R Bat  R a
nom 
R Bat  R a VBat   
  
R Bat  R a
   2
 VBat  
 R Bat  R a R Bat  R a
nom
EE-214/2011

Ventilador acionado por Motor DC


R Bat Ia R a

Ea J , B

V V
Bat
   
 
  kImot
B

   B 2
VBat
R Bat  R a V  Ea
   Bat
  2 R Bat  R a
nom 
R Bat  R a VBat   
  
R Bat  R a
   2
 VBat  
 R Bat  R a R Bat  R a
nom
EE-214/2011

Ventilador acionado por Motor DC

  kImot


VBat
R Bat  R a
RBAT + Ra 

  2

R Bat  R a

EE-214/2011

Ventilador acionado por Motor DC

  kImot


VBat
R Bat  R a
  2

R Bat  R a
VBAT 


EE-214/2011

Ventilador acionado por Motor DC

  kImot


VBat
R Bat  R a

Eixo Quebrado


EE-214/2011

Ventilador acionado por Motor DC

  kImot

Curto-ciruito


VBat Eixo-travado
R Bat  R a
  2

R Bat  R a


EE-214/2011

Imot

C
C

T
E – Escova com R T
T
N – Nominal
E
B – Bateria com V E E E
C – Curto N E
N N
T – Eixo Travado B N N
Q – Eixo Quebrado B
B
B B Q Q
Q Q
Q


EE-214/2011

Imot

C
C

T
E – Escova com R T
T
N – Nominal
E
B – Bateria com V E E E
C – Curto N E
N N
T – Eixo Travado B N N
Q – Eixo Quebrado B
B
B B Q Q
Q Q
Q


EE-214/2011

Imot
g(  , Imot ) = 0
C
< 0 > 0
C Curto-circuito

T Motor-travado
E – Escova com R T
T
N – Nominal
E
B – Bateria com V E E E
Eixo Quebrado
C – Curto N E
N N
T – Eixo Travado B N N
Q – Eixo Quebrado B
B
B B Q Q
d Q Q
Q
Qnew


EE-214/2011

0.2935 0.0151 0.3065 0.0135


1.0227 0.0016 0.9897 0.0021
0.2549 0.0121 0.2523 0.0127
0.2960 0.0131 0.3147 0.0141
0.2871 0.0151 0.2646 0.0120
1.0943 0.0021 0.3470 0.0158
0.3128 0.0138 0.3005 0.0138
0.3004 0.0143 0.2939 0.0142
0.2636 0.0122 0.3279 0.0177
0.3048 0.0140 0.3470 0.0158
0.3036 0.0131 0.2882 0.0143
0.3054 0.0139 0.3382 0.0159
0.9157 0.0023 0.2997 0.0150
0.3573 0.0155 0.3068 0.0140
0.2950 0.0131 0.3061 0.0142
0.3431 0.0155 0.3001 0.0132
0.3191 0.0135 0.2871 0.0151
0.3071 0.0143 0.3095 0.0140
0.2975 0.0140 0.2523 0.0127
0.3382 0.0159 0.2975 0.0136
0.2672 0.0122 0.3128 0.0148
0.3509 0.0159 0.3463 0.0162
0.3536 0.0149 0.3279 0.0177
0.2939 0.0142 0.2975 0.0136
0.3177 0.0134 0.2975 0.0136
0.2545 0.0123 0.3175 0.0130
0.2523 0.0127 0.3417 0.0164
0.3070 0.0147 0.3121 0.0134
0.3625 0.0165 0.2887 0.0148
0.2511 0.0120 0.3356 0.0167
0.3121 0.0134 0.2669 0.0114
0.3436 0.0148 0.2754 0.0122
0.2948 0.0140 0.3038 0.0131
0.3105 0.0133 0.2997 0.0150
0.2936 0.0143 0.2927 0.0149
0.9123 0.0019 0.2938 0.0135
0.2975 0.0136 0.3082 0.0146
0.2615 0.0125 0.2580 0.0123
0.9941 0.0021 0.2632 0.0120
0.9485 0.0022 0.3194 0.0138
0.2619 0.0116 1.0943 0.0021
0.3065 0.0135 0.2995 0.0135
0.3051 0.0135 0.2935 0.0151
EE-214/2011

0.2935 0.0151 0.3065 0.0135


1.0227 0.0016 0.9897 0.0021
0.2549 0.0121 0.2523 0.0127
0.2960 0.0131 0.3147 0.0141
0.2871 0.0151 0.2646 0.0120
1.0943 0.0021 0.3470 0.0158
0.3128 0.0138 0.3005 0.0138
0.3004 0.0143 0.2939 0.0142
0.2636 0.0122 0.3279 0.0177
0.3048 0.0140 0.3470 0.0158
0.3036 0.0131 0.2882 0.0143
0.3054 0.0139 0.3382 0.0159
Clusters? 0.9157
0.3573
0.0023
0.0155
0.2997
0.3068
0.0150
0.0140
0.2950 0.0131 0.3061 0.0142
0.3431 0.0155 0.3001 0.0132
0.3191 0.0135 0.2871 0.0151
0.3071 0.0143 0.3095 0.0140
0.2975 0.0140 0.2523 0.0127
0.3382 0.0159 0.2975 0.0136
0.2672 0.0122 0.3128 0.0148
0.3509 0.0159 0.3463 0.0162
0.3536 0.0149 0.3279 0.0177
0.2939 0.0142 0.2975 0.0136
0.3177 0.0134 0.2975 0.0136
0.2545 0.0123 0.3175 0.0130
0.2523 0.0127 0.3417 0.0164
0.3070 0.0147 0.3121 0.0134
0.3625 0.0165 0.2887 0.0148
0.2511 0.0120 0.3356 0.0167
0.3121 0.0134 0.2669 0.0114
0.3436 0.0148 0.2754 0.0122
0.2948 0.0140 0.3038 0.0131
0.3105 0.0133 0.2997 0.0150
0.2936 0.0143 0.2927 0.0149
0.9123 0.0019 0.2938 0.0135
0.2975 0.0136 0.3082 0.0146
0.2615 0.0125 0.2580 0.0123
0.9941 0.0021 0.2632 0.0120
0.9485 0.0022 0.3194 0.0138
0.2619 0.0116 1.0943 0.0021
0.3065 0.0135 0.2995 0.0135
0.3051 0.0135 0.2935 0.0151
EE-214/2011

Observou-se  = 0

No passado, a causa de motor parado tem sido:

- 70% casos = curto-circuito


- 30 % casos = eixo-travado

Sem dados adicionais

Curto-circuito é a causa mais provável

Critério Utilizado: P(curto) > P(travado)


EE-214/2011

Observou-se  = 0 e mediu-se a corrente Imot = 21 A

Dados Históricos

+ = eixo-travado
+ = curto-circuito

[A]
+ +++++ + +++++ +
10 20 30

Como aproveitar a informação de que

Imot = 21A ?
EE-214/2011

Observou-se  = 0 e mediu-se a corrente Imot = 21 A

Fórmula de Bayes Dados Históricos

P(a|b)= P(b|a)P(a)/P(b)
P(Imot|eixo-travado) P(Imot|curto-circuito)

P(curto|Imot)=P(Imot|curto)P(curto)/P(Imot)
[A]
P(travado|Imot)=P(Imot|travado)P(travado)/P(Imot) + +++++ + +++++ +
10 20 30
P(Imot) é comum nas 2 expressões
Imot

Eixo-travado é a causa mais provável

Critério Utilizado: P(travado | Imot ) > P(curto| Imot )


EE-214/2011

Notação Geral

1 = curto
2 = travado
P(curto|Imot)=P(Imot|curto)P(curto)/P(Imot) P(1|x)=P(x| 1)P(1)
x = Imot

P(travado|Imot)=P(Imot|travado)P(travado)/P(Imot) P(2|x)=P(x| 2)P(2)

P(travado | Imot ) > P(curto| Imot ) P(2|x) > P(1|x)

P(x| 2)P(2) > P(x| 1)P(1)


EE-214/2011

p x |  2  p  2   p x | 1  p 1   decide 

P(x| 2)P(2) > P(x| 1)P(1)


EE-214/2011

p x |  2  p  2   p x | 1  p 1   decide 

gi ( x )  p x | i  p i 

g2 ( x )  g1 ( x )  decide 

g 2 ( x )  g1 ( x )  0  decide 

g( x )  g 2 ( x )  g1 ( x )

  0  decide 

g(x) 
  0  decide 
 
EE-214/2011

p x |  2  p  2   p x | 1  p 1 
7

gi ( x )  log p x | i   log p i 
6
( 1, 1 )
5

No caso particular p x | i  ~ N  i , i  3

x2
2

1
( 2, 2 )
0

-1
-1 0 1 2 3 4 5 6 7 8
x1
EE-214/2011

p x |  2  p  2   p x | 1  p 1 

gi ( x )  log p x | i   log p i 

No caso particular p x | i  ~ N  i , i 

x  R d ; x ~ N  ,  
1  1 
p( x )  d 1
exp 
 2  x    T 1
  x    
 2  2 2  

1
gi ( x )    x    T  1  x     d log  2  1 log   log p i 
2 2 2
EE-214/2011

1
gi ( x )    x    T  1  x     d log  2  1 log   log p i 
2 2 2

Caso I :  i   2I i

14

12

10

8
x2

0
0 2 4 6 8 10 12 14
x1
EE-214/2011

1
gi ( x )    x    T  1  x     d log  2  1 log   log p i 
2 2 2
Caso I :  i   2I i

2
x  i
gi ( x )    log p i 
2 2

1
 
x T x  2 iT x   iT  i  log p i 
2 2

Igual para todos os


i

1 T  1 T 
gi ( x )   i x  
 2 2  i  i  log p  i  
2  
ai

 g( x )  gi ( x )  g j ( x ) 
1
 i   j  x  c ij
 2
EE-214/2011

1
gi ( x )    x    T  1  x     d log  2  1 log   log p i 
2 2 2

Caso I :  i   2I i

14

12
g(x)
10

8
x2

0
0 2 4 6 8 10 12 14
x1

 g( x )  gi ( x )  g j ( x ) 
1
 i   j  x  c ij
 2
EE-214/2011

1
gi ( x )    x    T  1  x     d log  2  1 log   log p i 
2 2 2

Caso II : i  
 arbitrário mas igual para 
10

g(x)
8

-2
0 1 2 3 4 5 6 7
EE-214/2011

1
gi ( x )    x    T  1  x     d log  2  1 log   log p i 
2 2 2

Caso III : i arbitrários (  cada i )

9 9

8
8

7
7
6

6
5

4 5

x2
3
4
2
3
1

0 2

-1 1
0 2 4 6 8 10 12 1 2 3 4 5 6 7 8 9
x1
EE-214/2011

11

10

6
x2

B
5

4 A
3

2
 A ou  B ?
1
0 2 4 6 8 10 12
x1
EE-214/2011

11

10

6
x2

B
5

4 A  A ou  B ?
3

1
0 2 4 6 8 10 12
x1
EE-214/2011

Distância de Mahalanobis

11

10

9 
8

7
d 2 ( x, )  ( x  ) T  1 ( x  ) 6

x2
5
B

4
A  A ou  B ?
3

2

1
0 2 4 6 8 10 12
x1
EE-214/2011

Distância

d: X  X  R+

Propriedades requeridas:
d(x,y)  0
d(x,y) = 0  x=y
d(x,y) = d(y,x)
d(x,z) + d(z,y)  d(x,y)

Distância de Minkowski:
Manhattan
1 k=1
 d
 k

k
d( x, y )   ai  bi 
 i1 
k=2
Euclidiana
EE-214/2011

Agrupamento Hierárquico

x2
Dados:

1.0 1.0
1.0 0.7
2 1.2 0.7
1.2 1.2
0.8 1.0
0.7 0.7
2.0 2.0
1 1.8 1.8
1.8 2.1
2.3 2.0
2.3 1.7
x1 2.0 2.4

1 2
EE-214/2011

>> x =

1.0000 1.0000
1.0000 0.7000 Dados:
1.2000 0.7000
1.2000 1.2000
0.8000 1.0000 1.0 1.0
0.7000 0.7000 1.0 0.7
2.0000 2.0000 1.2 0.7
1.8000 1.8000
1.8000 2.1000 1.2 1.2
2.3000 2.0000 0.8 1.0
2.3000 1.7000 0.7 0.7
2.0000 2.4000
2.0 2.0
>> y=pdist(x,'euclidean'); 1.8 1.8
1.8 2.1
>> z=linkage(y,'average');
2.3 2.0
>> dendrogram(z) 2.3 1.7
2.0 2.4
EE-214/2011

Agrupamento Hierárquico
1.6

1.4
Dados:

1.2
1.0 1.0
1.0 0.7
1.2 0.7
1
1.2 1.2
0.8 1.0
0.8
0.7 0.7
2.0 2.0
0.6 1.8 1.8
1.8 2.1
0.4 2.3 2.0
2.3 1.7
0.2 2.0 2.4
1 5 4 2 3 6 7 9 8 12 10 11
EE-214/2011

Agrupamento Hierárquico
x2
1.6
Dados:
1.4

1.2 1 1.0 1.0


2
2 1.0 0.7
1
3 1.2 0.7
0.8 4 1.2 1.2
1 5 0.8 1.0
0.6
6 0.7 0.7
0.4 7 2.0 2.0
x1
8 1.8 1.8
0.2

1 5 4 2 3 6 7 9 8 12 10 11
9 1.8 2.1
1 2 10 2.3 2.0
11 2.3 1.7
12 2.0 2.4
EE-214/2011

Agrupamento Hierárquico
x2
1.6
Dados:
1.4

1.2 1 1.0 1.0


2
2 1.0 0.7
1
3 1.2 0.7
0.8 4 1.2 1.2
1 5 0.8 1.0
0.6
6 0.7 0.7
0.4 7 2.0 2.0
x1
8 1.8 1.8
0.2

1 5 4 2 3 6 7 9 8 12 10 11
9 1.8 2.1
1 2 10 2.3 2.0
11 2.3 1.7
12 2.0 2.4
EE-214/2011

Agrupamento Hierárquico
x2
1.6
Dados:
1.4

1.2 1 1.0 1.0


2
2 1.0 0.7
1
3 1.2 0.7
0.8 4 1.2 1.2
1 5 0.8 1.0
0.6
6 0.7 0.7
0.4 7 2.0 2.0
x1
8 1.8 1.8
0.2

1 5 4 2 3 6 7 9 8 12 10 11
9 1.8 2.1
1 2 10 2.3 2.0
11 2.3 1.7
12 2.0 2.4
EE-214/2011

Agrupamento Hierárquico
x2
1.6
Dados:
1.4

1.2 1 1.0 1.0


2
2 1.0 0.7
1
3 1.2 0.7
0.8 4 1.2 1.2
1 5 0.8 1.0
0.6
6 0.7 0.7
0.4 7 2.0 2.0
x1
8 1.8 1.8
0.2

1 5 4 2 3 6 7 9 8 12 10 11
9 1.8 2.1
1 2 10 2.3 2.0
11 2.3 1.7
12 2.0 2.4
EE-214/2011

Agrupamento Hierárquico
x2
1.6
Dados:
1.4

1.2 1 1.0 1.0


2
2 1.0 0.7
1
3 1.2 0.7
0.8 4 1.2 1.2
1 5 0.8 1.0
0.6
6 0.7 0.7
0.4 7 2.0 2.0
x1
8 1.8 1.8
0.2

1 5 4 2 3 6 7 9 8 12 10 11
9 1.8 2.1
1 2 10 2.3 2.0
11 2.3 1.7
12 2.0 2.4
EE-214/2011

Agrupamento Hierárquico
x2
1.6
Dados:
1.4

1.2 1 1.0 1.0


2
2 1.0 0.7
1
3 1.2 0.7
0.8 4 1.2 1.2
1 5 0.8 1.0
0.6
6 0.7 0.7
0.4 7 2.0 2.0
x1
8 1.8 1.8
0.2

1 5 4 2 3 6 7 9 8 12 10 11
9 1.8 2.1
1 2 10 2.3 2.0
11 2.3 1.7
12 2.0 2.4
EE-214/2011

Agrupamento Hierárquico
x2
1.6
Dados:
1.4

1.2 1 1.0 1.0


2
2 1.0 0.7
1
3 1.2 0.7
0.8 4 1.2 1.2
1 5 0.8 1.0
0.6
6 0.7 0.7
0.4 7 2.0 2.0
x1
8 1.8 1.8
0.2

1 5 4 2 3 6 7 9 8 12 10 11
9 1.8 2.1
1 2 10 2.3 2.0
11 2.3 1.7
12 2.0 2.4
EE-214/2011

K-means

x2
Dados:

1.0 1.0
1.0 0.7
2 1.2 0.7
1.2 1.2
0.8 1.0
0.7 0.7
2.0 2.0
1 1.8 1.8
1.8 2.1
2.3 2.0
2.3 1.7
x1 2.0 2.4

1 2
EE-214/2011

>> x = idx =

1.0000 1.0000 2
1.0000 0.7000 2 Dados:
1.2000 0.7000 2
1.2000 1.2000 2
0.8000 1.0000 2 1.0 1.0
0.7000 0.7000 2 1.0 0.7
2.0000 2.0000 1
1.8000 1.8000 1 1.2 0.7
1.8000 2.1000 1 1.2 1.2
2.3000 2.0000 1 0.8 1.0
2.3000 1.7000 1
2.0000 2.4000 1 0.7 0.7
2.0 2.0
>> [idx,c]=kmeans(x,2) c = 1.8 1.8
2.0333 2.0000
1.8 2.1
0.9833 0.8833 2.3 2.0
2.3 1.7
2.0 2.4
EE-214/2011

>> x = idx =

1.0000 1.0000 2
1.0000 0.7000 2 Dados:
1.2000 0.7000 2
1.2000 1.2000 2
0.8000 1.0000 2 1.0 1.0
0.7000 0.7000 2 1.0 0.7
2.0000 2.0000 1
1.8000 1.8000 1 1.2 0.7
1.8000 2.1000 1 1.2 1.2
2.3000 2.0000 1 0.8 1.0
2.3000 1.7000 1
2.0000 2.4000 1 0.7 0.7
2.0 2.0
>> [idx,c]=kmeans(x,2) c = 1.8 1.8
2.0333 2.0000
1.8 2.1
0.9833 0.8833 2.3 2.0
2.3 1.7
2.0 2.4
EE-214/2011

K-means

x2 c = 2.0333 2.0000
0.9833 0.8833
Dados:

1.0 1.0
1.0 0.7
2 1.2 0.7
1.2 1.2
0.8 1.0
0.7 0.7
2.0 2.0
1 1.8 1.8
1.8 2.1
2.3 2.0
2.3 1.7
x1 2.0 2.4

1 2
EE-214/2011

K-means

x2

x1

1 2
EE-214/2011

K-means

x2

x1

1 2
EE-214/2011

K-means

x2

x1

1 2
EE-214/2011

K-means

x2

x1

1 2
EE-214/2011

K-means

x2

x1

1 2
EE-214/2011

K-means

x2

x1

1 2
EE-214/2011

K-means

x2

x1

1 2
EE-214/2011

K-means

x2

x1

1 2
EE-214/2011

K-means

x2

x1

1 2
EE-214/2011

K-means

x2

x1

1 2
EE-214/2011

K-means

x2

x1

1 2
EE-214/2011

K-means

x2

x1

1 2
EE-214/2011

Ventilador acionado por Motor DC


EE-214/2011

40

35 Centróides
30 251,5 12,2
0,0 19,5
25 1.000,7 2,5
351,0 16,0
corrente [A]

20 0,0 30,7
298,4 14,0
15

10

0
0 200 400 600 800 1000 1200
rotaçao [rpm]
EE-214/2011

40

35 800

5 700
30

600
25
corrente [A]

500
20 2
4 400
15 6
300
10 1
200

5 3 100

0 0
0 200 400 600 800 1000 1200 2 5 1 6 4 3
rotaçao [rpm]
EE-214/2011

Aprendizado Competitivo

Padrão 1 Padrão 2 Padrão 3

RNA

Entrada
EE-214/2011

A regra competitiva de atualização dos pesos é:


w i*  n  1  w i*  n     x n   w i*  n  

O tamanho do passo  (0 <  < 1) controla o tamanho da atualização em


cada passo.

vencedor  arg min


i
 x  wi
2

wi wi* wi

x
EE-214/2011

x=

2.8912 4.6925 7.0299 2.6696


2.6977 4.1531 5.4482 1.8907
3.0674 4.6355 6.9373 3.1359
3.3912 5.3341 6.3841 2.7066
3.0143 2.7596 7.3473 3.1661
3.6210 4.2673 6.4294 3.3694
2.8230 2.7786 6.0328 0.7340
>> P=x'; 3.8884 3.7128 6.3068 3.6512
2.2805 4.1053 7.4664 3.3202
>> net=newc([0 10 ; 0 20],3); 3.0817 2.5987 6.0249 2.4205
2.0551 2.6898 4.2419 11.8915
>> net=train(net,P); 2.4385 4.2339 4.1505 11.0143
2.3248 4.0878 4.2313 11.6063
3.3256 4.9084 3.4451 10.9294
>> xsim = sim(net,P); 2.7722 2.1358 3.7475 11.7190
2.4511 4.5631 3.7444 12.5351
>> Yc = vec2ind(xsim); 3.0654 4.4797 3.6118 9.6320
2.9662 5.4541 3.9555 9.5597
2.7239 3.9596 4.2682 9.6711
2.1473 4.1791 4.4645 12.2583
6.0088 0.6796 4.3494 11.9162
5.3473 1.1695 4.0312 10.1017
6.3248 1.9968 3.5433 11.4301
4.9683 1.6344 3.9182 9.4428
5.3939 2.2423 4.1586 10.8102
6.0501 2.6200 4.0116 13.5573
6.4412 2.3042 4.0372 10.7638
6.4970 1.3510 3.6609 11.7846
6.1491 2.6364 3.3139 11.4386
7.3517 3.8455 3.9235 10.7200
EE-214/2011

NEWC Create a competitive layer.


net = newc(PR,S,KLR,CLR)

>> P=x'; TRAIN Train a neural network.

>> net=newc([0 10 ; 0 20],3); [net,tr,Y,E,Pf,Af] =


train(NET,P,T,Pi,Ai,VV,TV)
>> net=train(net,P);

>> xsim = sim(net,P); VEC2IND Transform vectors to indices.

>> Yc = vec2ind(xsim); vec =

1 0 0 0
0 0 1 0
0 1 0 1

ind =

1 3 2 3
EE-214/2011

x=

16 2.8912 4.6925 7.0299 2.6696


2.6977 4.1531 5.4482 1.8907
3.0674 4.6355 6.9373 3.1359
3.3912 5.3341 6.3841 2.7066
14 3.0143 2.7596 7.3473 3.1661
3.6210 4.2673 6.4294 3.3694
2.8230 2.7786 6.0328 0.7340
3.8884 3.7128 6.3068 3.6512
12
2.2805 4.1053 7.4664 3.3202
3.0817 2.5987 6.0249 2.4205
2.0551 2.6898 4.2419 11.8915
10 2.4385 4.2339 4.1505 11.0143
2.3248 4.0878 4.2313 11.6063
x2

3.3256 4.9084 3.4451 10.9294


2.7722 2.1358 3.7475 11.7190
8 2.4511 4.5631 3.7444 12.5351
3.0654 4.4797 3.6118 9.6320
2.9662 5.4541 3.9555 9.5597
6 2.7239 3.9596 4.2682 9.6711
2.1473 4.1791 4.4645 12.2583
6.0088 0.6796 4.3494 11.9162
5.3473 1.1695 4.0312 10.1017
4 6.3248 1.9968 3.5433 11.4301
4.9683 1.6344 3.9182 9.4428
5.3939 2.2423 4.1586 10.8102
6.0501 2.6200 4.0116 13.5573
2 6.4412 2.3042 4.0372 10.7638
0 1 2 3 4 5 6 7 8 9
6.4970 1.3510 3.6609 11.7846
x1 6.1491 2.6364 3.3139 11.4386
7.3517 3.8455 3.9235 10.7200
EE-214/2011

16

14 Padrão 1 Padrão 1 Padrão 2 Padrão 3


12

10
RNA
x2

8
Padrão 3
6 Entrada
Padrão 2
4

2
0 1 2 3 4 5 6 7 8 9
x1
EE-214/2011

16

14
Padrão Padrão Padrão Padrão
12
1 1 2 3

10
RNA
x2

8
Padrão
6 3 x1 = 2 x 2 =
Padrão
4 2 4

2
0 1 2 3 4 5 6 7 8 9
x1
EE-214/2011

16

14
Padrão Padrão Padrão Padrão
12
1 1 2 3

10
RNA
x2

8
Padrão
6 3 x1 = 6 x 2 =
Padrão
5
4 2
2
0 1 2 3 4 5 6 7 8 9
x1
EE-214/2011

Redes de Kohonen
• RNA de 1 camada simples composta de uma camada de entrada e
outra de saída
• Aprendizado não-supervisionado

Unidades Unidades
de Entrada concorrentes
de Saída
EE-214/2011

Redes de Kohonen

Unidades Unidades concorrentes


de Entrada de Saída
EE-214/2011

1. Camada de entrada é apresentada

Unidades Unidades concorrentes


de Entrada de Saída
EE-214/2011

2. A distância do padrão de entrada para os pesos para cada unidade de


saída é calculada através da fórmula euclidiana:
y j || x  w j ||2
Onde j é a unidade de saída e y j é a distância resultante.

Unidades Unidades concorrentes


de Entrada de Saída
EE-214/2011

• Cada vez que um vetor de entrada é apresentado para a rede, a distância


em relação a ele para cada unidade na camada de saída é calculada
• A unidade de saída com a menor distância em relação ao vetor de
entrada é a vencedora

unidade
Unidades Unidades concorrentes vencedora
de Entrada de Saída
EE-214/2011

• Os pesos são ajustados de acordo com o vencedor


• Os vizinhos se aproximam de acordo com o treinamento e a estrutura
se auto-organiza

unidade
Unidades Unidades concorrentes vencedora
de Entrada de Saída
EE-214/2011

w i  n  1  w i  n    i ,i*  n   x n   w i  n  

  d i ,i* 2 
 i ,i*  n   exp 2 
 2  n  
 

vencedor  arg min


i
 x  wi
2

di,i*
wi wi* wi

x
EE-214/2011

Sexo Idade

Pessoas de Sexo e Idades Variados


EE-214/2011
EE-214/2011
EE-214/2011
EE-214/2011

x=

1.6972 4.2944 6.2926 5.5689


0.8341 2.6638 7.4301 4.7444
P=x'; 2.0877 4.7143 7.3554 4.6225
net = newsom([0 10; 0 20],[1 3],... 2.2014 5.6236 8.1847 4.7041
'gridtop','dist',0.9,200,0.01,0); 1.1975 3.3082 7.4139 3.5249
net.trainParam.epochs = 100; 2.8336 4.8580 6.5495 4.7660
2.8324 5.2540 7.2662 5.1184
net = train(net,P);
1.9737 2.4063 6.2936 5.3148
2.2291 2.5590 6.9863 6.4435
2.1222 4.5711 6.9662 4.6490
1.8693 3.6001 3.2493 9.5747
2.5081 4.6900 3.3196 8.3572
1.5882 4.8156 3.3764 12.1836
3.5282 4.7119 2.6032 10.3776
1.9045 5.2902 3.0848 11.3928
NEWSOM Create a self-organizing map. 2.0798 4.6686 3.0952 11.2809
2.7467 5.1908 2.5969 11.0258
net = newsom(PR,[d1,d2,...],tfcn,dfcn,olr,osteps,tlr,tns) 2.0415 2.7975 2.7032 9.7953
1.9330 3.9802 3.4329 9.8634
1.4174 3.8433 2.9474 10.5507
PR - Rx2 matrix of min and max values for R input elements. 5.8771 5.0000 3.1560 9.5769
Di - Size of ith layer dimension, defaults = [5 8]. 7.1801 4.6821 3.0352 9.7329
TFCN - Topology function, default = 'hextop'. 6.2605 6.0950 2.7458 12.7670
DFCN - Distance function, default = 'linkdist'. 7.9906 3.1260 2.7762 11.0669
6.4364 5.4282 3.1775 9.5392
OLR - Ordering phase learning rate, default = 0.9. 7.3701 5.8956 2.6200 10.9505
OSTEPS - Ordering phase steps, default = 1000. 7.1535 5.7310 3.3125 9.6460
TLR - Tuning phase learning rate, default = 0.02; 6.3547 5.5779 3.2276 9.3809
TNS - Tuning phase neighborhood distance, default = 1. 5.4805 5.0403 2.6713 10.6867
6.9586 5.6771 2.8938 12.1442
EE-214/2011

Weight Vectors
14

12

10
W(i,2)

-2 0 2 4 6 8 10
W(i,1)

net = newsom([0 10; 0 20],[1 3],'gridtop','dist',0.9,200,0.01,0);


EE-214/2011

Weight Vectors

12

Padrão Padrão Padrão Padrão


10 1 1 2 3

8
W(i,2)

RNA
6
Padrão
Padrão 3
x1 = 2 x 2 =
4 2 4
2
-2 0 2 4 6 8 10
W(i,1)

et = newsom([0 10; 0 20],[1 3],'gridtop','dist',0.9,200,0.01,1);


EE-214/2011

Weight Vectors

12

10

8
W(i,2)

2
-2 0 2 4 6 8 10
W(i,1)

net = newsom([0 10; 0 20],[1 50],'gridtop','dist',0.9,200,0.01,3);


EE-214/2011

Weight Vectors

13
Neuron Positions
1.8

12 1.6

1.4

1.2

11

position(2,i)
1

0.8

0.6

10 0.4

0.2

9
0 0.5 1 1.5 2 2.5
position(1,i)
W(i,2)

3
-2 0 2 4 6 8 10
W(i,1)

net = newsom([0 10; 0 20],[3 3],'hextop','dist',0.9,200,0.01,1);


EE-214/2011

EM (Expectation-Maximization)
EE-214/2011
EE-214/2011
EE-214/2011
EE-214/2011
EE-214/2011
EE-214/2011
EE-214/2011
EE-214/2011

Cluster A Cluster B
EE-214/2011

Cluster A Cluster B
EE-214/2011

>> [W,M,V,L] = EM_GM(X,3,[],[],1,[])

EM algorithm for k multidimensional Gaussian mixture estimation

X(n,d) - input data


n=number of observations
d=dimension of variable
k - maximum number of Gaussian components allowed
ltol - percentage of log likelihood difference between 2 iterations
maxiter - maximum number of iteration allowed ([] for none)
pflag - 1 for plotting GM for 1D or 2D cases only, 0 otherwise
Init - structure of initial W, M, V: Init.W, Init.M, Init.V

W(1,k) - estimated weights of GM


M(d,k) - estimated mean vectors of GM
V(d,d,k) - estimated covariance matrices of GM
L - log likelihood of estimates

Patrick P. C. Tsui,
Dept of Electrical and Computer Eng
University of Waterloo
EE-214/2011

x=

2.8912 4.6925 7.0299 2.6696


16 2.6977 4.1531 5.4482 1.8907
3.0674 4.6355 6.9373 3.1359
3.3912 5.3341 6.3841 2.7066
14 3.0143 2.7596 7.3473 3.1661
3.6210 4.2673 6.4294 3.3694
2.8230 2.7786 6.0328 0.7340
3.8884 3.7128 6.3068 3.6512
12 2.2805 4.1053 7.4664 3.3202
3.0817 2.5987 6.0249 2.4205
2.0551 2.6898 4.2419 11.8915
10 2.4385 4.2339 4.1505 11.0143
2.3248 4.0878 4.2313 11.6063
3.3256 4.9084 3.4451 10.9294
x2

2.7722 2.1358 3.7475 11.7190


8 2.4511 4.5631 3.7444 12.5351
3.0654 4.4797 3.6118 9.6320
2.9662 5.4541 3.9555 9.5597
2.7239 3.9596 4.2682 9.6711
6 2.1473 4.1791 4.4645 12.2583
6.0088 0.6796 4.3494 11.9162
5.3473 1.1695 4.0312 10.1017
4 6.3248 1.9968 3.5433 11.4301
4.9683 1.6344 3.9182 9.4428
5.3939 2.2423 4.1586 10.8102
6.0501 2.6200 4.0116 13.5573
2 6.4412 2.3042 4.0372 10.7638
0 1 2 3 4 5 6 7 8 9 6.4970 1.3510 3.6609 11.7846
x1 6.1491 2.6364 3.3139 11.4386
7.3517 3.8455 3.9235 10.7200
EE-214/2011

Muito Obrigado!

Você também pode gostar