132
Zadar, August 2010 1 Learning from an informant Colin de la Higuera University of Nantes

Learning from an informant

  • Upload
    joanne

  • View
    61

  • Download
    6

Embed Size (px)

DESCRIPTION

Learning from an informant. Colin de la Higuera University of Nantes. Acknowledgements. Laurent Miclet, Jose Oncina and Tim Oates for previous versions of these slides. - PowerPoint PPT Presentation

Citation preview

Page 1: Learning from an informant

Zadar, August 2010 1

Learning from an informant

Colin de la HigueraUniversity of Nantes

Page 2: Learning from an informant

Zadar, August 2010 2

Acknowledgements Laurent Miclet, Jose Oncina and Tim Oates for previous

versions of these slides. Rafael Carrasco, Paco Casacuberta, Rémi Eyraud,

Philippe Ezequel, Henning Fernau, Thierry Murgue, Franck Thollard, Enrique Vidal, Frédéric Tantini,...

List is necessarily incomplete. Excuses to those that have been forgotten.

http://pagesperso.lina.univ-nantes.fr/~cdlh/slides/

Chapter 12 (and part of 14)

Page 3: Learning from an informant

Zadar, August 2010 3

Outline

1. The rules of the game2. Basic elements for learning DFA3. Gold’s algorithm4. RPNI5. Complexity discussion6. Heuristics7. Open questions and conclusion

Page 4: Learning from an informant

Zadar, August 2010 4

1 The rules of the game

Page 5: Learning from an informant

Zadar, August 2010 5

Motivation

We are given a set of strings S+ and a set of strings S-

Goal is to build a classifier This is a traditional (or typical) machine

learning questionHow should we solve it?

*

Page 6: Learning from an informant

Zadar, August 2010 6

Ideas

Use a distance between strings and try k-NN

Embed strings into vectors and use some off-the-shelf technique (decision trees, SVMs, other kernel methods)

Page 7: Learning from an informant

Zadar, August 2010 7

Alternative

Suppose the classifier is some grammatical formalism

Thus we have L and *\L

*

L

Page 8: Learning from an informant

Zadar, August 2010 8

Informed presentations

An informed presentation (or an informant) of L* is a function f : ℕ * {-,+} such that f(ℕ)=(L,+)(L,-)

f is an infinite succession of all the elements of * labelled to indicate if they belong or not to L.

Page 9: Learning from an informant

Zadar, August 2010 9

Obviously many possible candidates

Any Grammar G such that S+ L(G)

S- L(G) =But there is an infinity of such

grammars!

Page 10: Learning from an informant

Zadar, August 2010 10

Structural completeness

(of S+ re a DFA)

each edge is used at least onceeach final state accepts at least one string

Look only at DFA for which the sample is structurally complete!

Page 11: Learning from an informant

Zadar, August 2010 11

S+={aab, b, aaaba, bbaba}

a b

a

a

a

b

b

b

Example

Page 12: Learning from an informant

Zadar, August 2010 12

S+={aab, b, aaaba, bbaba} …

a b

a

a

a

b

b

b

add and abb

Page 13: Learning from an informant

Zadar, August 2010 13

Defining the search space by structural completeness

(Dupont, Miclet, Vidal 94) the basic operation: merging two states a bias on the concepts : structural

completeness of the positive sample S+ a theorem: every biased solution can and

can only be obtained by merging states in CA(S+)

the search space is a partition lattice.

Page 14: Learning from an informant

Zadar, August 2010 14

{3}{0, 1, 2}

{0}{1}{2}{3}

{0, 1}{2, 3}

{2}{0, 1, 3}{1}{0, 2, 3}{0} {1, 2, 3}

{0, 2}{1, 3} {0, 3}{1, 2}

{0, 1, 2, 3}

{0, 1}{2}{3} {0, 2}{1}{3} {0, 3}{1}{2}{1, 3}{0}{2} {1, 2}{0}{3}{2, 3}{0}{1}

Page 15: Learning from an informant

Zadar, August 2010 15

3

a

aa

aa

a

aa

a

2

a

0,1,2

10,1

1,2

0,1

0 2

11

1,2

0,2

a a

a

a

10a a

3 2,3

0 1 2 3

a a0,3

3 2

0 1,3

2

0 1,2,3

0, 1, 2, 3

0,2 1,32,3

3 0,3

0,1,3 0,2,3a a

a a a

aa

a

a

a a

a

aa

aa

a

a a

a a

a

S- = {a}S+={aaa}

Page 16: Learning from an informant

Zadar, August 2010 16

The partition lattice Let E be a set with n elements The number of partitions of E is given

by the Bell number

n.Cn

n

p

pn

01

10

(16)=10 480 142 147

Page 17: Learning from an informant

Zadar, August 2010 17

Regular inference as search

another result: the smallest DFA fitting the examples is in the lattice constructed on PTA(S+)

generally, algorithms would start from PTA(S+) and explore the corresponding lattice of solutions using the merging operation. S- is used to control the generalization.

Page 18: Learning from an informant

Zadar, August 2010 18

CA (S+) or PTA(S+)

UniversalAutomaton

Border Set

Page 19: Learning from an informant

Zadar, August 2010 19

2 Basic structures

Page 20: Learning from an informant

Zadar, August 2010 20

Two types of final states

2

a

a

a

S+={, aaa}S-={aa, aaaaa}

1

3

1 is accepting3 is rejectingWhat about state 2?

Page 21: Learning from an informant

Zadar, August 2010 21

What is determinism about?

2

1

4

3

a

a

Merge 1 and 3?

2

1

a

2,41

a

4

a

But…

Page 22: Learning from an informant

Zadar, August 2010 22

The prefix tree acceptor

The smallest tree-like DFA consistent with the data

Is a solution to the learning problemCorresponds to a rote learner

Page 23: Learning from an informant

Zadar, August 2010 23

From the sample to the PTA

a

a

aa

b

b

b

a

a

a

ba b

a

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

S+={, aaa, aaba, ababa, bb, bbaaa}S-={aa, ab, aaaa, ba}

PTA(S+)

Page 24: Learning from an informant

Zadar, August 2010 24

From the sample to the PTA (full PTA)

a

a

aa

b

b

b

a

a

a

ba b

a

1

2

3

4

5

7

8

9

10

11

13

14

15

16

17

S+={, aaa, aaba, ababa, bb, bbaaa}S-={aa, ab, aaaa, ba}

12a

6a

PTA(S+,S-)

Page 25: Learning from an informant

Zadar, August 2010 25

Red, Blue and White states

a

a

ab

b

b

a

ba

-Red states are confirmed states-Blue states are the (non Red) successors of the Red states-White states are the others

Page 26: Learning from an informant

Zadar, August 2010 26

Merge and fold

1

8

2

5

3

a

a

ab

b

b

7a

6

4

ba

9

Suppose we want to merge state 3 with state 2

Page 27: Learning from an informant

Zadar, August 2010 27

Merge and fold

1

8

2

5

3

a,b

a

ab

b

7a

6

4

ba

9

First disconnect 3 and reconnect to 2

Page 28: Learning from an informant

Zadar, August 2010 28

Merge and fold

1

8

2

5

3

a,b

aa

b

b

7a

6

4

ba 9

Then fold subtree rooted in 3 into the DFA starting in 2

Page 29: Learning from an informant

Zadar, August 2010 29

Merge and fold

1

8

2

a,b

a

a

b

6

4

ba

9

Then fold subtree rooted in 3 into the DFA starting in 2

Page 30: Learning from an informant

Zadar, August 2010 30

Other search spaces

an augmented PTA can be constructed on both S+ and S- (Coste 98, Oliveira 98)• but not every merge is possible• the search algorithms must run

under a set of dynamic constraints

Page 31: Learning from an informant

Zadar, August 2010 31

State splitting

Searching by splitting

start from the one-state universal automaton, keep constructing DFA controlling the search with <S+, S-

>

Page 32: Learning from an informant

Zadar, August 2010 32

That seems a good idea… but take a5*. What 4 (or 3, 2, 1) state automaton is a decent approximation of a5* ?

a

a

a

a

a

Page 33: Learning from an informant

Zadar, August 2010 33

3 Gold’s algorithm

E. M. Gold. Complexity of automaton identification from given data.

Information and Control, 37:302–320, 1978.

Page 34: Learning from an informant

Zadar, August 2010 34

Key ideas

Use an observation tableRepresent the states of an automaton

as strings, prefixes of the strings in the learning set

Find some incompatibilities between these prefixes due to separating suffixes

This leads to equivalent prefixes Invent the other equivalences

Page 35: Learning from an informant

Zadar, August 2010 35

Strings as states

[] [b]

[bb]

bb

a

a

[a]

a

Page 36: Learning from an informant

Zadar, August 2010 36

Incompatible prefixes

S+={aab}

S-={bab} Then clearly there are at least 2 states,

one corresponding to a and another to b.

Page 37: Learning from an informant

Zadar, August 2010 37

Observation table

The information is organised in a table <STA,EXP,OT> where: RED * is the set of states BLUE * is the set of transitions

BLUE=(RED.)\RED EXP * is the experiment set OT: (STA=REDBLUE)EXP {0,1,*} such

that:OT[u][e] = 1 if ue S+

0 if ue S-

* otherwise

Page 38: Learning from an informant

Zadar, August 2010 38

The states (RED)

The transitions (BLUE)

The experiments (EXP)

a

a

ab

aa

b

1 0

*0

01

0*

**

An observation table

Page 39: Learning from an informant

Zadar, August 2010 39

Meaning

(q0, .)F L

a

a

abaab

1 0

*0

*10*0*

Page 40: Learning from an informant

Zadar, August 2010 40

(q0,ab.a) F

aba L

a

a

abaab

1 0*0

*10*01

Page 41: Learning from an informant

Zadar, August 2010 41

Redundancy

a aa

a

abaab

1 * 0

* 0 0

* * 10 0 01 * 1

Must have identical label (redundancy)

Page 42: Learning from an informant

Zadar, August 2010 42

DFA consistent with a table

a

a

abaab

1 0*0

*10*01

1 2aa

b

b

1 2

a

a,b

b

Both DFA are consistent with this table

Page 43: Learning from an informant

Zadar, August 2010 43

Closed table without holes

Let uREDBLUE and let OT[u][e] denote a cell

OT[u] denotes the row indexed by u We say that the table is closed if tBLUE, sRED : OT[t] = OT[s]

We say that the table has no holes if uRED BLUE, eE OT[u][e]{0,1}

Page 44: Learning from an informant

Zadar, August 2010 44

a

a

abaab

1 000

010001

This table is closed

Page 45: Learning from an informant

Zadar, August 2010 45

This table is not closed

a

a

abaab

1 000

011001

Not closed

Page 46: Learning from an informant

Zadar, August 2010 46

An equivalence relation

Let <RED,EXP,OT> be a closed table and with no holes. Consider the equivalence relation over STA:

s1s2 if

OT[s1] =OT[s2] a OT[s1a] = OT[s2a]

Class of s is denoted by [s] (also!)

Page 47: Learning from an informant

Zadar, August 2010 47

Equivalent prefixes

a

a

abaab

1 000

010001

prefixes and b are equivalent since OT[]=OT[b]

Page 48: Learning from an informant

Zadar, August 2010 48

Building an automaton from a table

We define A(<STA,EXP,OT>) = (,Q,,q0,F) as follows: Q = {[s]: s RED } q0 = [] F = {[ue]: OT[u][e] = 1} ([s1], a)=

[s2a] if s2[s1]: s2a RED

any [s] : s RED OT[s] =OT[s1a]

Page 49: Learning from an informant

Zadar, August 2010 49

a

a

abaab

1 010

010110 [] [a ]

ba

a

b

Page 50: Learning from an informant

Zadar, August 2010 50

Compatibility Theorem:

Let <STA,EXP,0T> be an observation table closed and with no holes

If STA is prefix-complete and EXP is suffix-complete then A(<STA,EXP,OT>) is compatible with the data in <STA,EXP,OT>

Page 51: Learning from an informant

Zadar, August 2010 51

Example

RED = []Q = {[]} q0 = [] F = {[]}

b

b 1 1 b 1 1

Page 52: Learning from an informant

Zadar, August 2010 52

Exercise

Build a DFA from either of these two tables

b bbb 1 1 0b 1 1 0

0a 1

aaa 0

aaaa 0

Page 53: Learning from an informant

Zadar, August 2010 53

Building the initial table from a sample

Given a sample S and a set of strings (RED) prefix-complete, it is always possible to select a set of experiments E such that the table <STA,E,OT> contains all the information in S

But usually this table is going to have holes

Page 54: Learning from an informant

Zadar, August 2010 54

Obviously different rows

Let s1,s2 RED BLUE

we say that OT[s1] is obviously different from OT[s2] if

eE:OT[s1][e],OT[s2][e]{0,1}

and OT[s1][e] OT[s2][e]

a

a

abaab

1 000

010010

Page 55: Learning from an informant

Zadar, August 2010 55

If tBLUE such that OT[t] is obviously different from any OT[s], (sRED) then no filling of holes in <RED,EXP,OT> can produce a closed table.

a

a

abaab

1 000

*1*01*

ab is OD with each s

Page 56: Learning from an informant

Zadar, August 2010 56

Algorithm

RED {} build <RED,E,OT> with E suffix-

complete while xBLUE: OT[x] is OD do

add x to RED

update BLUEupdate <STA,E,OT>

Page 57: Learning from an informant

Zadar, August 2010 57

Q REDq0 F {tRED : OT[t][] = 1}(t,a) ta if taRED

t' if t'RED and not OD

if <STA,EXP,OT> is incompatible with S, return the PTA

There can be several such t’

Page 58: Learning from an informant

Zadar, August 2010 58

Example run

S+={bb, abb, bba, bbb}

S-={a, b, aa, ba, bab}

a b aa ab ba bb abb bab bba bbb

a

b

* 0 0 0 * 0 1 1 0 1 1

0 0 * * * * 1 * * * *

0 0 1 * 0 1 1 * * * *

and b are OD

Page 59: Learning from an informant

Zadar, August 2010 59

a b aa ab ba bb abb bab bba bbb

ba

* 0 0 0 * 0 1 1 0 1 1

0 0 * * * * 1 * * * *

0 0 1 * 0 1 1 * * * *

1) We promote line b

bb

ba 0 * 0 * * * * * * * *

1 1 1 * * * * * * * *

2) We expand the table, adding rows ba and bb

3) bb is OD

Page 60: Learning from an informant

Zadar, August 2010 60

a b aa ab ba bb abb bab bba bbb

b

a

* 0 0 0 * 0 1 1 0 1 1

0 0 * * * * 1 * * * *

0 0 1 * 0 1 1 * * * *

1) We promote line bb

bb

ba 0 * 0 * * * * * * * *

1 1 1 * * * * * * * *

2) We expand the table, adding rows bba and bbb

bbabbb

1 * * * * * * * * * *1 * * * * * * * * * *

3) We construct the automaton as no line is OD

Page 61: Learning from an informant

Zadar, August 2010 61

a b

b

a

* 0 0

0 0 *

0 0 1bb

ba 0 * 0

1 1 1

bbabbb

1 * *1 * *

[] [b]

[bb]

bb

a

b

a

a

Now the * have to be replaced

Page 62: Learning from an informant

Zadar, August 2010 62

a b

b

a

* 0 0

0 0 *

0 0 1bb

ba 0 * 0

1 1 1

bbabbb

1 * *1 * *

[] [b]

[bb]

b

b

a

b

a

a

Wild guess!

Page 63: Learning from an informant

Zadar, August 2010 63

[] [b]

[bb]

bb

a

b

a

a

S+={bb, abb, bba, bbb}S-={a, b, aa, ba, bab}

The automaton is inconsistent. We shall have to return the PTA instead.

Page 64: Learning from an informant

Zadar, August 2010 64

But !

aGold is deterministic: it takes deterministic decisions in order to solve the « filling holes » question

In practice it will very often return the PTA

Page 65: Learning from an informant

Zadar, August 2010 65

Equivalence of problems

Let RED be a state test set prefix-complete, and S be a sample. Let <STA,EXP,OT> be an observation table consistent with all the data in S, with EXP suffix-completeThe question:Does there exist a DFA with the states of RED and compatible with S?

is equivalent to:Can we fill the holes such that <STA,EXP,OT> is closed?

Page 66: Learning from an informant

Zadar, August 2010 66

Complexity

The problem:is there a DFA with states in RED and compatible with S?

is NP-Complete

Page 67: Learning from an informant

Zadar, August 2010 67

Corollary

Given S and a positive integer n, the question:Is there a DFA with n states compatible with S?

is NP-Complete

Page 68: Learning from an informant

Zadar, August 2010 68

Properties of aGold

1) the output is consistent with a sample S2) aGold identifies in the limit any regular

language3) aGold works in time polynomial in |S|

4) if the size of the target is n, then there is a characteristic sample CS with |CS|= 2n2(||+1), such that aGold(S) produces the canonical acceptor for all SCS

Page 69: Learning from an informant

Zadar, August 2010 69

Open questions

Can one fill the holes in a more “intelligent” way?

How fast can we detect that a choice (for a filling) is good or bad?

Page 70: Learning from an informant

Zadar, August 2010 70

Exercise

Run Gold’s algorithm for the following data:

S+={a, abb, bab, babbb}

S-={ab, bb, aab, b, aaaa, babb}

Page 71: Learning from an informant

Zadar, August 2010 71

4 RPNI

Regular Positive and Negative Grammatical Inference

Inferring regular languages in polynomial time. Jose Oncina & Pedro García. Pattern recognition

and image analysis, 1992

Page 72: Learning from an informant

Zadar, August 2010 72

RPNI is a state merging algorithmRPNI identifies any regular language in

the limitRPNI works in polynomial timeRPNI admits polynomial characteristic

sets

Page 73: Learning from an informant

Zadar, August 2010 73

A=PTA(S+); Blue ={(qI,a): a };

Red ={qI}

While Blue dochoose q from Blueif pRed: L(merge_and_fold(A,p,q))S-= then A = merge_and_fold(A,p,q)

else Red = Red {q}Blue = {(q,a): qRed} – {Red}

Page 74: Learning from an informant

Zadar, August 2010 74

S+={, aaa, aaba, ababa, bb, bbaaa}

a

a

aa

b

b

b

a

a

a

ba b

a

S-={aa, ab, aaaa, ba}

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

Page 75: Learning from an informant

Zadar, August 2010 75

Try to merge 2 and 1

a

a

aa

b

b

b

a

a

a

ba b

a

S-={aa, ab, aaaa, ba}

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

Page 76: Learning from an informant

Zadar, August 2010 76

First merge, then fold

a

aa

b

b

b

a

a

a

ba b

a

S-={aa, ab, aaaa, ba}

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

a

Page 77: Learning from an informant

Zadar, August 2010 77

But now string aaaa is accepted, so the merge must be rejected, and state 2 is promoted

a

b

b a

a

a

ab

a

S-={aa, ab, aaaa, ba}

1,2,4,7

3,5,86

9, 11

10

12

13

14

15

Page 78: Learning from an informant

Zadar, August 2010 78

Try to merge 3 and 1

a

a

aa

b

b

b

a

a

a

ba b

a

S-={aa, ab, aaaa, ba}

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

Page 79: Learning from an informant

Zadar, August 2010 79

First merge, then fold

1

a

a

aa

b b

b

a

a

a

ba b

a

S-={aa, ab, aaaa, ba}

2

3

4

5

6

7

8

9

10

11

12

13

14

15

Page 80: Learning from an informant

Zadar, August 2010 80

No counter example is accepted so the merge is kept

a

a

aa

bb

a ba

S-={aa, ab, aaaa, ba}

1,3,6

2,10

4,13

5

7,15

8

9

11

12

14

b

Page 81: Learning from an informant

Zadar, August 2010 81

Next possible merge to be checked is {4,13} with {1,3,6}

a

a

aa

bb

a ba

S-={aa, ab, aaaa, ba}

1,3,6

2,10

4,13

5

7,15

8

9

11

12

14

b

Page 82: Learning from an informant

Zadar, August 2010 82

Merged. Needs folding subtree in {4,13} with {1,3,6}

a

aa

bb

a ba

S-={aa, ab, aaaa, ba}

1,3,6

2,10

4,13

5

7,15

8

9

11

12

14

b

a

Page 83: Learning from an informant

Zadar, August 2010 83

a ba b

a

S-={aa, ab, aaaa, ba}

1,3,4,6,8,13

2,7,10,11,15

5

9

12

14

b

a

But now aa is accepted

Page 84: Learning from an informant

Zadar, August 2010 84

So we try {4,13} with {2,10}

a

a

aa

bb

a ba

S-={aa, ab, aaaa, ba}

1,3,6

2,10

4,13

5

7,15

8

9

11

12

14

b

Page 85: Learning from an informant

Zadar, August 2010 85

Negative string aa is again accepted.Since we have tried all Red for merging, state 4 is promoted.

a ba b

a

S-={aa, ab, aaaa, ba}

1,3,62,4,7,10,13,15

5,8

9,11 12

14

b

a

Page 86: Learning from an informant

Zadar, August 2010 86

So we try 5 with {1,3,6}

a

a

aa

bb

a ba

S-={aa, ab, aaaa, ba}

1,3,6

2,10

4,13

5

7,15

8

9

11

12

14

b

Page 87: Learning from an informant

Zadar, August 2010 87

But again we accept ab

aa

aa

b

b

S-={aa, ab, aaaa, ba}

1,3,5,6,12

2,9,10,14

4,13

7,15

8

11

b

Page 88: Learning from an informant

Zadar, August 2010 88

So we try 5 with {2,10}

a

a

aa

bb

a ba

S-={aa, ab, aaaa, ba}

1,3,6

2,10

4,13

5

7,15

8

9

11

12

14

b

Page 89: Learning from an informant

Zadar, August 2010 89

Which is OK. So next possible merge is {7,15} with {1,3,6}

a

a

a

ab

b

S-={aa, ab, aaaa, ba}

1,3,6

2,5,10

4,9,13

7,15

8,12

11,14

b

Page 90: Learning from an informant

Zadar, August 2010 90

Which is OK. Now try to merge {8,12} with {1,3,6,7,15}

a a

a

ab

a

S-={aa, ab, aaaa, ba}

1,3,6,7,15

2,5,10

4,9,13

8,12

11,14

b

b

Page 91: Learning from an informant

Zadar, August 2010 91

And ab is accepted

a

a

b

a

S-={aa, ab, aaaa, ba}

1,3,6,7,8,12,15

2,5,10,11,14

4,9,13

b

b

Page 92: Learning from an informant

Zadar, August 2010 92

Now try to merge {8,12} with {4,9,13}

a a

a

ab

a

S-={aa, ab, aaaa, ba}

1,3,6,7,15

2,5,10

4,9,13

8,12

11,14

b

b

Page 93: Learning from an informant

Zadar, August 2010 93

This is OK and no more merge is possible so the algorithm halts

a a

a

b

a

S-={aa, ab, aaaa, ba}

1,3,6,7,11,14,15

2,5,10

4,8,9,12,13

b

b

Page 94: Learning from an informant

Zadar, August 2010 94

Properties

RPNI identifies any regular language in the limit

RPNI works in polynomial time. Complexity is

in O(║S+║3.║S-║) There are many significant variants of RPNI RPNI can be extended to other classes of

grammars

Page 95: Learning from an informant

Zadar, August 2010 95

Exercices Run RPNI on

S+={a,bba,bab,aabb}

S-={b,ab,baa,baabb}

Find a characteristic sample for:

0

1

2

a

a

ba

1

b b3

Page 96: Learning from an informant

Zadar, August 2010 96

5 Complexity issues

Page 97: Learning from an informant

Zadar, August 2010 97

A characteristic sample

A sample is characteristic (for some algorithm) whenever, when included in the learning sample, the algorithm returns the correct DFA

The characteristic sample should be of polynomial size

There is an algorithm which given a DFA builds a characteristic sample

Page 98: Learning from an informant

Zadar, August 2010 98

Definition : polynomial characteristic sample

G has polynomial characteristic samples for identification algorithm a if there exists a polynomial p() such that: given

any G in G, CS correct sample for G, such that when CSfn, a(fn)G and ║CS║ p(║G ║)

Page 99: Learning from an informant

Zadar, August 2010 99

About characteristic samples

If you add more strings to a characteristic sample it still is characteristic

There can be many different characteristic samples (EDSM, tree version,…)

Change the ordering (or the exploring function in RPNI) and the characteristic sample will change

Page 100: Learning from an informant

Zadar, August 2010 100

Open problems

RPNI’s complexity is not a tight upper bound. Find the correct complexity

The definition of the characteristic sample is not tight either. Find a better definition

Can there be a linear time DFA learner?

Page 101: Learning from an informant

Zadar, August 2010 101

Collusion

Collusion consists in having the learner and the teacher agree of some specific encoding system. Then, the teacher can just pass one string which is the encodinng of the target.

Is that cheating? Is that learning?

Page 102: Learning from an informant

Zadar, August 2010 102

6 Heuristics

Page 103: Learning from an informant

Zadar, August 2010 103

6.1 Genetic Algorithms

The principle: via evolutionary mechanisms nature increases the quality of its population.

Allow a population of solutions to interact and evolve.

Page 104: Learning from an informant

Zadar, August 2010 104

Mechanisms (gene level):

Mutation Crossing-over

(a solution is just a string)

Page 105: Learning from an informant

Zadar, August 2010 105

Mutation

TTAGCCTTC

TTTGCCTTC

Page 106: Learning from an informant

Zadar, August 2010 106

Crossing-over

TTATCCGT TAGGCTTC

TTATC CGT TAGG CTTC

TTATC CTTC TAGG CGT

TTATCCTTC TAGGCGT

Page 107: Learning from an informant

Zadar, August 2010 107

Idea: define the solutions as sequences

Be able to measure the quality of a solution

Conceive a first generationDefine the genetic operations

(mutation, crossing over) Keep the best elements of the second

generation Iterate

Page 108: Learning from an informant

Zadar, August 2010 108

Genertic algorithms in Grammatical Inference

(Dupont 94) code the automata (the partition of states

of PTA(S+)) into partitions define genetic operators define an optimum as an automaton with as

few states as possible and rejecting S-

run the genetic algorithm

Page 109: Learning from an informant

Zadar, August 2010 109

Structural Mutation

Select a state from a block and move it to another block

Example:{{1,3} {2} {4,5}}

{{1} {2} {3,4,5}}

{{1} {2} {3} {4,5}}

Page 110: Learning from an informant

Zadar, August 2010 110

Structural crossover

{1,2}{3,4,5} {1,3}{4}{2,5}

{1,3}{3,4,5} {1,2}{4}{2,5}{1,2,3}{4,5} {1,2,3}{4}{5}

Page 111: Learning from an informant

Zadar, August 2010 111

Group number encoding

Partition

{{1,2,6}{3,7,9,10}{4,8,12}{5}{11}}

is encoded by

(112341232253)

Page 112: Learning from an informant

Zadar, August 2010 112

(Giordano 96, based on Glover 89)

General idea: search a space by choosing a point, and going to its best neighbor that is not in the tabu list.

6.2 Tabu search

Page 113: Learning from an informant

Zadar, August 2010 113

R the set of rules of the grammars in the search space

G an initial grammarG* G the best solution reached so farT the Tabu list that cannot occurk 0 the iterations counter

Page 114: Learning from an informant

Zadar, August 2010 114

While k kmax doselect r in R\T, such that the addition or

deletion of r from G realizes the maximum of val on X

add or delete r from Gif val(G)>val(G*) then G* G Update Tk k+1

Return G*

Page 115: Learning from an informant

Zadar, August 2010 115

Procedure Update(T, r)if card(T) = n then delete its last elementAdd r as the first element of T

Tricks If blocked then delete oldest rule blocked 6 iterations if new G* then empty(T)

Page 116: Learning from an informant

Zadar, August 2010 116

6.3 Heuristic greedy State Merging

RPNI chooses to merge the first 2 states that can be merged

This is an optimistic view There may be another… But remember: RPNI identifies in the limit!

Page 117: Learning from an informant

Zadar, August 2010 117

How do greedy state merging algorithms work?

choose two states perform a cascade of forced merges to get

a deterministic automaton if it accepts sentences of S-, backtrack and

choose another couple if not, loop until no merging is still possible

Page 118: Learning from an informant

Zadar, August 2010 118

a

b

b

a

a ab

a

a

a

a

a

b

abb

b

b

a

ab

baa

b

The blue fringe (Lang 98)

Page 119: Learning from an informant

Zadar, August 2010 119

What moves are allowed?

Merging a with a Promoting a to and all its

successors that are not to

Promotion: when a can be merged with no

Page 120: Learning from an informant

Zadar, August 2010 120

What if there are many merges possible?

Heuristics compute a score choose highest score

Page 121: Learning from an informant

Zadar, August 2010 121

a

b

b

a

a ab

a

a

a

a

a

b

abb

b

b

a

ab

baa

b

The blue fringe (Lang 98)

Page 122: Learning from an informant

Zadar, August 2010 122

Evidence driven (Lang 98)

for each possible pair ( , ) doparse S+ and S- on A resulting from the

mergeassign a score to each state of A according

to the sentences that they acceptif there is a conflict: -else the number of sentences acceptedsum over all states the score of the

mergeselect the merge with the highest score

Page 123: Learning from an informant

Zadar, August 2010 123

Data driven (cdlh, Oncina & Vidal 96)

Sw

Sw

quqwefuqv

quqwefuqv

,:Pr

,:Pr

0

0

v,vminv,vmin

For every or state in A count

Choose the pair ( , ) such that

is maximal

Page 124: Learning from an informant

Zadar, August 2010 124

Careful

Count first...

...then try to merge

Keep track of all tries

if some is not mergeable, promote

it!

Page 125: Learning from an informant

Zadar, August 2010 125

Main differences

data driven is cheaper evidence driven won Abbadingo

competition

In the stochastic case, it seems that data driven is a good option…

Page 126: Learning from an informant

Zadar, August 2010 126

a ab b c

c

PTA(ababc , +) (c , +)

(aac , -) (ab , -) (abac , -)(a,-)

c

6.4 Constraint Satisfaction

a c

1 2 1 2 1 3

3 2

4

4

Page 127: Learning from an informant

Zadar, August 2010 127

a ab b c

c

c

a c

(ababc , +) (c , +)

(aac , -) (ab , -) (abac , -)(a,-)

Inconsistent

Page 128: Learning from an informant

Zadar, August 2010 128

Consider (Q, incompatible)

All you have to do is find a maximum clique…

Another NP-hard problem, but for which good heuristics exist.

Careful : the maximum clique only gives you a lower bound...

Page 129: Learning from an informant

Zadar, August 2010 129

Alternatively

You have Q variables S1..SQ, and n values 1..n.

You have constraints SiSj

or Si=Sj Sk=Sl

Solve.

Biermann 72, Oliveira & Silva 98, Coste & Nicolas 98

Page 130: Learning from an informant

Zadar, August 2010 130

7 Open questions and conclusions

Page 131: Learning from an informant

Zadar, August 2010 131

Other versions

A Matlab version of RPNIhttp://www.sec.in.tum.de/~hasan/matlab/gi_toolbox/1.0-Beta/

A JAVA version http://pagesperso.lina.univ-nantes.fr/~cdlh/Downloads/RPNIP.tar.g

z

A parallel version exists, and an OCAML, C, C++…

Page 132: Learning from an informant

Zadar, August 2010 132

Some open questions

Do better than EDSM (still some unsloved Abbadingo task out there…)

Write a O(║f(n)║) algorithm which identifies DFA in the limit (Jose Oncina and cdlh have a log factor still in the way)

Identify and study the collusion issuesDeal with noise.