conserving fitness evaluations by
play

Conserving Fitness Evaluations by Marking Used Transitions Daniil - PowerPoint PPT Presentation

Learning Finite-State Machines: Conserving Fitness Evaluations by Marking Used Transitions Daniil Chivilikhin and Vladimir Ulyantsev National Research University of IT, Mechanics and Optics St. Petersburg, Russia Machine Learning Applications


  1. Learning Finite-State Machines: Conserving Fitness Evaluations by Marking Used Transitions Daniil Chivilikhin and Vladimir Ulyantsev National Research University of IT, Mechanics and Optics St. Petersburg, Russia Machine Learning Applications in Software Engineering @ ICMLA’13 December 6, 2013

  2. Outline • Motivation and scope • Proposed idea • Experiments – Artificial Ant problem – Test-based EFSM induction • Conclusion Learning FSMs: Conserving 2 Fitness Evaluations

  3. Motivation and scope 3

  4. Motivation: Reliable software • Systems with high cost of failure – Energy industry – Aircraft industry – Space industry – … • We want to have reliable software – Testing is not enough – Verification is needed Learning FSMs: Conserving 4 Fitness Evaluations

  5. Verification • Checking temporal rules (e.g. LTL ) • Software verification can be harder than software development • Need to make software that satisfies LTL- specification by design • How? Learning FSMs: Conserving 5 Fitness Evaluations

  6. Model-driven development • Automated software engineering • Model-driven development Software Model Code specification Learning FSMs: Conserving 6 Fitness Evaluations

  7. Model-driven development Finite-state machine Software Model Code specification Learning FSMs: Conserving 7 Fitness Evaluations

  8. Finite-State Machine • Σ – set of input events T / z 3 • Δ – set of output actions 1 • δ : S ×Σ → S – transition function • λ : S ×Σ → Δ – actions function A / z 3 T / z 1 2 A / z 2 Learning FSMs: Conserving 8 Fitness Evaluations

  9. Automata-based programming Output Events Design programs with actions z 1 complex behavior as e 1 z 2 automated-controlled z 2 z 3 e 2 objects z 4 Automated-controlled object Events Finite-state Controlled machine object Actions Learning FSMs: Conserving 9 Fitness Evaluations

  10. Automata-based programming: advantages • Model before programming code, not vice versa Finite-state machine Model Code • Possibility of program verification using Model Checking • You can check temporal properties (LTL) Learning FSMs: Conserving 10 Fitness Evaluations

  11. Issues • Hard to build an FSM with desired structure and behavior • One of approaches – mutation-based metaheuristics Learning FSMs: Conserving 11 Fitness Evaluations

  12. Mutation-based FSM learning • Evolution Strategies (ES) • Genetic Algorithms (GA) • Mutation-based Ant Colony Optimization (MuACO) All these algorithms use FSM mutations Learning FSMs: Conserving 12 Fitness Evaluations

  13. Mutation-Based Ant Colony Optimization • Proposed by the authors of this work in 2012 • Based on Ant Colony Optimization • Can be thought of as an ES “with memory” • No time to go into detail  Learning FSMs: Conserving 13 Fitness Evaluations

  14. Solution representation Transition table Output table δ λ Event Event State A T State A T 1 1 2 1 z 1 z 2 2 2 1 2 z 2 z 3 Learning FSMs: Conserving 14 Fitness Evaluations

  15. FSM Mutations T / z 3 1 Change Change transition T / z 1 A / z 3 transition action end state 2 A / z 2 T / z 3 T / z 3 1 1 A / z 3 A / z 1 T / z 1 T / z 1 2 2 A / z 2 A / z 2 Learning FSMs: Conserving 15 Fitness Evaluations

  16. Proposed idea 16

  17. Fitness evaluation: used transitions Calculated fitness Used transitions Learning FSMs: Conserving 17 Fitness Evaluations

  18. Mutation Mutate this transition Learning FSMs: Conserving 18 Fitness Evaluations

  19. Observation Used Compute transition fitness Mutation Fitness Unused has not transition changed Learning FSMs: Conserving 19 Fitness Evaluations

  20. Challenge OK, found a way not to calculate fitness of FSMs in some cases 1.Can we design an efficient implementation ? 2.Will it make a difference in performance ? 3.Limits of applicability? Learning FSMs: Conserving 20 Fitness Evaluations

  21. Implementation • Store an array of transition usage marks for each FSM • Mark used transitions during fitness evaluation • Copy marks when not calculating fitness Learning FSMs: Conserving 21 Fitness Evaluations

  22. Domain knowledge • Black box – no domain knowledge • General domain knowledge about FSMs • Problem-specific domain knowledge Learning FSMs: Conserving 22 Fitness Evaluations

  23. Experiments Learning FSMs: Conserving 23 Fitness Evaluations

  24. Experiments: Purpose • Does it make a difference? • How much resources does it require? Learning FSMs: Conserving 24 Fitness Evaluations

  25. Experiments: Algorithms • Evolutionary strategy (ES) • Genetic algorithm (GA) • Mutation-Based Ant Colony Optimization for learning FSMs (MuACOsm) Learning FSMs: Conserving 25 Fitness Evaluations

  26. Experiments: Problems 1. Artificial Ant Problem 2. Learning EFSMs from tests Learning FSMs: Conserving 26 Fitness Evaluations

  27. General experimental setup 1. Tune each algorithm for time t tune – Using full factorial design of experiment 2. Run each algorithm with tuned parameters Learning FSMs: Conserving 27 Fitness Evaluations

  28. Artificial Ant Problem • Toroidal field N × N • M pieces of food • K time steps • Fixed position of food and the ant • Goal – build an FSM, such that the ant will eat all food in K steps Field example: John Muir Trail Learning FSMs: Conserving 28 Fitness Evaluations

  29. Artificial Ant: Fitness function   K s 1   last f n food K • n food – number of eaten food pieces • K – max number of allotted steps • s last – number of used steps eaten food f used time steps Learning FSMs: Conserving 29 Fitness Evaluations

  30. Success rate • Successful run: fitness ≥ 89 • Success rate = N succesful runs / N runs Learning FSMs: Conserving 30 Fitness Evaluations

  31. Experiment design • Vary number of states • Limited number of fitness evaluations • Measure: – Success rate – Time Learning FSMs: Conserving 31 Fitness Evaluations

  32. Success rate 32

  33. ES median time 33

  34. GA median time 34

  35. MuACO median time 35

  36. ES Fitness 36

  37. GA Fitness 37

  38. MuACO Fitness 38

  39. Ratio of lazy evaluations 39

  40. Fitness evaluation time: plain algorithms 40

  41. Fitness evaluation time: with marking 41

  42. Statistical Significance • ANOVA test • Fitness distributions significantly different for ES and MuACOsm • Insignificant for GA Learning FSMs: Conserving 42 Fitness Evaluations

  43. Learning Extended Finite-State Machines from tests (1) Learning FSMs: Conserving 43 Fitness Evaluations

  44. Learning Extended Finite-State Machines from tests (2) Input data: • Number of states C and sets Σ and Δ • Set of test examples T • T i =<input sequence I j, output sequence O j > NP-hard problem: build an EFSM with C states compliant with tests T Learning FSMs: Conserving 44 Fitness Evaluations

  45. Example of a test A H T[x 1 ] T[x1 & x2] → z 1 z 1 z 2 z 5 z 7 Learning FSMs: Conserving Fitness 45 Evaluations

  46. Learning EFSMs: Fitness function • Pass inputs to EFSM, record outputs • Compare generated outputs with references • Fitness = string similarity measure (edit distance) Learning FSMs: Conserving 46 Fitness Evaluations

  47. Experimental setup 1. Generate random EFSM with C states 2. Generate set of tests of total length C × 150 3. Learn EFSM from tests 4. Experiment for each C repeated 100 times 5. Limited number of fitness evaluations Learning FSMs: Conserving 47 Fitness Evaluations

  48. Success rate 48

  49. Mean fitness 49

  50. Fitness evaluations 50

  51. Median time 51

  52. Time for fitness evaluation 52

  53. Conclusion Developed approach – Applicable to all FSM learning algorithms that use mutations – Allows to explore more FSMs with the same number of fitness evaluations – Effectively improves fitness and time Learning FSMs: Conserving 53 Fitness Evaluations

  54. Limitations • Makes sense to use if cost of fitness computation is relatively high Learning FSMs: Conserving 54 Fitness Evaluations

  55. Future work Explore more ways of using domain knowledge in FSM learning algorithms Learning FSMs: Conserving 55 Fitness Evaluations

  56. Acknowledgements • University ITMO research project 610455 • Ministry of Education and Science of Russian Federation in the framework of the federal program “Scientific and scientific -pedagogical personnel of innovative Russia in 2009- 2013” (contract 16.740.11.0455, agreement 14.B37.21.0397) Learning FSMs: Conserving 56 Fitness Evaluations

  57. Thank you for your attention! Learning FSMs: Conserving Fitness Evaluations by Marking Used Transitions Daniil Chivilikhin Vladimir Ulyantsev {chivdan,ulyantsev}@rain.ifmo.ru This presentation online: http://rain.ifmo.ru/~chivdan/papers/2013/icmla-2013- presentation.pdf Learning FSMs: Conserving 57 Fitness Evaluations

Recommend


More recommend