La presentazione è in caricamento. Aspetta per favore

La presentazione è in caricamento. Aspetta per favore

Introduzione alla logica sfumata

Presentazioni simili


Presentazione sul tema: "Introduzione alla logica sfumata"— Transcript della presentazione:

1 Introduzione alla logica sfumata
Introduction to Fuzzy Logic Insieme sfumato Fuzzy Set Dominio di definizione; definition space: x  X  R L’insieme sfumato è definito dalla funzione di appartenenza; Fuzzy set defined by its membership function: mA(x) 0  mA(x) 1 ,x  X Insieme vuoto; Empty set F: mf(x)=0 per xX ; Insieme universo; Univers set S: mS(x) =1 per xX Insieme unione; Union set: AB mAB (x)=max[mA(x);mB(x)] Insieme intersezione; Intersection set: AB mAB(x)=min[mA(x);mB(x)] Insieme complementare; complement set: A* di of A : mA(x)+mA*(x)=1= mS(x)

2 A* insieme complementare di A: mA*(x) =1-mA(x)
mF(x) mS(x)=1 1 mA*(x) mB(x) mA(x) x mF(x)=0 10 X=(0<x<10) Fuzzy sets: : mF(x)=0 per xX S: mS(x)=1 per xX A insieme sfumato generico mA(x) = 01 per xX A* insieme complementare di A: mA*(x) =1-mA(x) Vettore sfumato; Fuzzy vector: C(x)= (c1,c2,…,cM) = (mc1(x), mc2(x),…, mcM(x))

3 Per Insiemi Booleani; For Boolean Sets:
Principio di esclusione; Exclusion principle: AA* = S; AA* = F AA* : mAA* (x) = max[mA(x),mA*(x)]≤ 1 AA* : mAA* (x) = min[mA(x),mA*(x)] ≥0 Gli insiemi sfumati non godono del principio di esclusione; Exclusion principle is not valid for Fuzzy sets A  A*  S AA*  F

4 Insiemi sfumati di insiemi sfumati (funzioni sfumate a più valori)
Fuzzy sets of fuzzy sets: (multivalued fuzzy functions) y1 yj yM mC(B) C(xi,yj) mC(A) mB(yj) B A mA(xi) x xi xM

5 A mC2(x) S=(1,1) (0,1) (2/3,1/4) (1,0) mC1(x) F=(0,0)
Vettore sfumato c =(c1 , c2) nel piano delle sue funziomi di appartenenza Fuzzy vector c =(c1 , c2) in the plane of the membership functions

6 Struttura di un sistema per l’ elaborazione sfumata
Segnali analogici Analog signals Antecedenti: variabili linguistiche a più valori (simboli) Antecedents: Multivalued linguistic variables (symbols) Quantizzatore sfumata Fuzzifier Elaboratore linguistico Linguistic processor Quantificatore Defuzzier Segnale analogico Analog signal variabile linguistica a più valori (simbolo): Conseguente Multivalued linguistic variable (symbol): Consequent Struttura di un sistema per l’ elaborazione sfumata Fuzzy set processor

7 Riconoscitore basato sulla logica sfumata Fuzzy recognition system
Segnali analogici Analog signals Antecedenti: variabili linguistiche a più valori (simboli) Antecedents: Multivalued linguistic variables (symbols) Massimo degli ingressi Max of input Quantizzatore sfumato Fuzzifier Elaborazione linguistica Linguistic processing Classe riconosciuta Selected class grado di apparteneza:conseguente membership value: consequent Riconoscitore basato sulla logica sfumata Fuzzy recognition system

8 1 X mi(x); i=0,1 (appartenenza alla variabile binaria) binario sfumato
binario booleano 1 m0(x) m1(x) Vm T VM x X Fig. 2 Funzioni di appartenenza alla variabile binaria ( codificatore binario booleano e codificatore binario sfumato)

9 mai(x), i= P,M,G maG(x) maP(x) maM(x) 1 A x 10 = {aP ,aM ,aG}
10 = {aP ,aM ,aG} A Funzioni di appartenenza di una grandezza sfumata a tre valori (piccolo:P, medio: M,grande: G) Membership functions of a three valued fuzzy variable (small:P,medium:M, large: G)

10 Esempio di trasformazione degli antecedenti Ae B nel conseguente C
aMP aM aG aP B cM cG cP cP bP cM bG cP cG cMG A={aMP,aP,xM,aG} C={cP,cM,cG,cMG} B={bP,bG} C= f(A,B) Valori delle funzioni di appartenenza dell’ uscita dell’ elaboratore linguistico (AND = min[.,.,...] OR = max[.,.,...] Esempio di trasformazione degli antecedenti Ae B nel conseguente C Example of the mapping of antecedents A,B into the conequent C mP(z)= max { min [ mMP(x), mP(y)], min [mMP(x),mG(y)], min[ mP (x),mg(y)]} mM(z)= max { min [ mM(x), mP(y)], min [mP(x),mG(y)]} mG(z)= max { min [ mG(x), mP(y)], min [mM(x),mG(y)]} mMG(z)= max { min [ mG(x), mG(y)]}

11 mI F1 mF1 mU QS; F mO F2 mF2 mA QS;F mE Elab. Ling. I…E argmax F1 MP P
V={I,U,O,A,E} F1={MP, P,M,G} F2={B,A} Riconoscimento di vocali con logica sfumata Fuzzy vowel recognition

12 1 1 -1 1 1 -1 -1 -1 -1 1 1 -1 -1 1 1 1 1 A -1 B B= NOT(A) A -1 B A -1
1 B 1 -1 B= NOT(A) A -1 1 B A -1 1 B -1 -1 -1 -1 1 1 -1 -1 1 1 1 1 C= OR(A,B) C= AND(A,B) Trasformazioni di funzioni logiche a tre valori Basic three valued logic variable transformation

13 y= (Si yi Ai)/(Si Ai) con i = P,M,G
mi(y), mG(y) mP(y) mM(y) 1 AP AM mP(y) = .8 mM(y) = .3 AG y mG(y) = .1 yP yM yG y= (Si yi Ai)/(Si Ai) con i = P,M,G Quantificazione con il metodo dei centroidi Method of the centroids for fuzzy quantification

14 + _ Quantificatore Defuzzifier (MLP) x^ mx x e
Quantizzatore sfumato Fuzzifier mx x e _ Realizzazione del Quantificatore con un Percettrone Multistrato Implementation of the Defuzzifier using a Multi LayerPperceptron

15 Classificatore sfumato delle trasformate DCT di blocchi d’ immagine
l(i,j) c(m,n) class T’ T S B argmax [mHI,mMH,mML,mLO] Linguistic Processor DCT L’ Fuzzifier L Input: Image luminance I(i,j) Preprocessed input pattern: DCT Transforms Input pattern: Total (T’)and low frequency (L’) energies: T’ = S |c(m,n)|-|c(0,0)|, m,n = 0-7 L’ = S |c(m,n)|-|c(0,0)|, m,n = 0-3 Antecedents:Fuzzy Total Energy: T={VS, SM, ML, LG} Fuzzy Low Frequency Energy: L={SM, LG} Conseguents: Visibility Block Classification: B={LO,ML,MH,HI} Classificatore sfumato delle trasformate DCT di blocchi d’ immagine Image DCT Block fuzzy Classifier

16 Funzioni di appartenenza per la codifica sfumata di T ed L
mVS, mSM, mML, mLG ML VS SM LG 1 T 100 mSM, mLG LG SM 1 L 100 Funzioni di appartenenza per la codifica sfumata di T ed L Membership functions used for T and L fuzzification

17 Trasformazione linguistica dell’ attivita’ dei blocchi DCT
VS SM ML LG L ML MH SM LO HI LG LO ML HI HI mHI = max [ min ( mLG, mBG), min (mSM ,mBG), min( mLG ,mMD)] mMH = max [. . .] mML = max[. . . ] mLO = max [. . . ] Trasformazione linguistica dell’ attivita’ dei blocchi DCT Linguistic transformation of the DCT blocks Classe: 1 se mHI = max[mHI ,mMH, mML, mLO], Classe 2 se mMH = max[mHI ,mMH, mML, mLO], Classe 3 se mML = max[mHI ,mMH, mML, mLO], Classe 4 se mLO = max[mHI ,mMH, mML, mLO]

18 + _ Errore di posizione; position error: (e=x-y)
me x + _ e c s Controllore sfumato Fuzzy controller y q s mv inseguitore (motore) me’ e’ D(e)/Dt mvp Dt Errore di posizione; position error: (e=x-y) Antecedenti; antecedents: Errore; error: e={N,Z,P}, Derivata dell’ errore; error derivative: e’={N,Z,P}, Velocita’ al tempo n-1; speed at time n-1: vp={N,Z,P} Conseguente; consequent: Velocita’; speed:v={N,Z,P} Controllore PID sfumato per motori Fuzzy PID motor controller

19 Apprendimento dei classificatori sfumati
Learning of the fuzzy classifiers Metodo del gradiente per l’addestramento dei quantizzatori sfumati; Gradient method for the learning of the fuzzifier Problema della derivazione delle funzioni discontinue; issues of the differentation of discontinous functions) max(x,a)/x = 1 if x>a else max(x,a)/x = 0 b) Addestramentodi tutti i blocchi (CS, Trasf. Linguistico, QS) Learning of all the blocks (Fuzzifier, Ling. mapping, Defuzzzifier) Si utilizza l’architettura ANFIS; we use the ANFIS architecture (Adaptive Network-based Fuzzy Inference System; Sistema d’inferenza sfumato basato su una rete adattativa )

20 Problema: date P coppie di addestramento (xp,zp; p=1÷P) della z=z(x)
Introduzione all’architettura ANFIS,Introduction to the ANFIS architecture z z(x) z2 zP z1 zp z0= wr x0= -r/p x x1 x2 xp xP Problema: date P coppie di addestramento (xp,zp; p=1÷P) della z=z(x) Estrapolare (inferire) la z(x) come combinazione pesata di M interpolatori lineari : z=Siwi(pix+ri) Problem: P learning pairs (xp,zp; p=1÷P) of a z=z(x) are given.Infer the z(x) as a weighted linear combination of M linear interpolator: z=Siwi(pix+ri)

21 Quantif. Defuzzifier (OR) x m y : S z + w f AND
xl xm xh y 1 2 i 8 9 : S z + w f AND = p q r Architettura ANFIS; ANFIS architecture QS F Quantif. Defuzzifier (OR)

22 Dettagli dell’architettura ANFIS; details of the ANFIS architecture
m1 w1 w1 A1 / L1(x) X m2 x w2 z w2 A2 / L2(x) + X + m3 w3 w3 A3 / L3(x) X + Quantizzatori sfumati Fuzzifiers x P N QuantificatoriDefuzzifiers Generatori dei Mintermini Minterm generators Normalizzatori dei mintermini Minterm normalizers IF (A1 AND A2) THEN (w1=m1m2) w1= w1/(w1+ w2+w3) Li(x)= pix+ri Dettagli dell’architettura ANFIS; details of the ANFIS architecture

23 Rappresentazione matematica di ANFIS
Mathematical respresentation of ANFIS Quantizzatori sfumati; Fuzzifiers: mi(x)= exp((x-ci)/ai)2,… (i=1÷K) Generatore dei mintermini (AND aritmetico o logico); minterm generators: mhk =mh(x)mk(x),… (h;k=1÷K; mhk=mkh) Normalizzatore dei pesi; weights normalizer: wj= wi/(w1+…+ wi+…+wI),…. With i=1÷I, I=K(K-1)/2) Interpolatori lineari; Linear interpolators: Li(x)= pix+ri Quantificatore; Defuzzifier: z=Siwi(pix+ri) In the specific case z(x)= w1 L1(x)+w2L2(x)+w3L3(x)

24 Metodo: K funzioni di appartenenza degli ingressi; K membership functions
Il numero dei tratti lineari che vengono pesati con pesi funzione dell’ingresso sono Numero d’interpolatori lineari; number of linear interpolators; I≤ K(K-1)/2 Nell’esempio; in the example K=2, I=3: z(x) ~ w1(x) L1(x)+w2(x)L2(x)+w3(x)L3(x) L2(x) L1(x) z z(x) L3(x) w1L1(x) w3L3(x) w2L2(x) x mi(x) m2(x) m3(x) m1(x) x

25 Parametri; parameters
Parametri dei quantizzatori sfumati; Fuzzifier parameters: ai,ci (i=1÷K) Parametri delle rette interpolatrici; linear interpolator parameters: pi,ri (i=1÷K(K-1)/2)) Coppie d’addestramento; training pairs: (xp,zp; p=1÷P) P>>K2 Addestramento ibrido; Hybrid Learning: pi e ri ottimizzati con metodo dei minimi quadrati LSE (sistema lineare sovradimensionato di P equazioni); pi and ri optimized using LSE method (overdimensioned linear system of P equations) 2) ai e ci ottimizzati con il metodo del gradiente e retropropagazione dell’errore EBP per ogni coppia d’addestramento; ai and ci optimized using the gradient method and EBP for each training pair. Riferimento: Jyh-Shing Roger Jang: ANFIS: Adaptive_Network-Based Fuzzy Inference System, IEEE Transactions on Systems, Man, and Cybernetics, Vol. 23 No pp


Scaricare ppt "Introduzione alla logica sfumata"

Presentazioni simili


Annunci Google