1 / 27

Boost Character-Based Matching in Learning Classifier Systems with Xor

Gilles ÉNÉE and Mathias PEROUMALNAÏK LAMIA laboratory University of Antilles and Guyana French West Indies. Boost Character-Based Matching in Learning Classifier Systems with Xor. Presentation Overview. Character-based Matching Context Algorithm Logic Experimentations Pure matching

juan
Download Presentation

Boost Character-Based Matching in Learning Classifier Systems with Xor

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Gilles ÉNÉE and Mathias PEROUMALNAÏK LAMIA laboratory University of Antilles and Guyana French West Indies Boost Character-Based Matching in Learning Classifier Systems with Xor

  2. Presentation Overview Character-based Matching • Context • Algorithm Logic Experimentations • Pure matching • XCS and APCS Conclusion 13th International Workshop on Learning Classifier Systems - Gilles Enée (gilles.enee@univ-ag.fr)

  3. Character-based Matching Context • 65 % of computational time spent with matching (Llora and al. 2006) • Changing encoding is not always faster (Butz and al. 2008) • Can we do better ? (Lanzi presentation in 2008) 13th International Workshop on Learning Classifier Systems - Gilles Enée (gilles.enee@univ-ag.fr)

  4. Character-basedMatching 13th International Workshop on Learning Classifier Systems - Gilles Enée (gilles.enee@univ-ag.fr)

  5. Character-basedMatching Let’s suppose that R[1] contains condition[pos], R[2] inputs[pos] • (condition[pos]==‘#’) || (condition[pos]==inputs[pos]) || (inputs[pos]==‘#’) Will be written in assembler • Cmpi R[3], R[1],’#’ • Jeq R[3], end_match_test • Cmp R[3], R[1], R[2] • Jeq R[3], end_match_test • Cmpi R[3], R[2], ‘#’ • Jne R[3], end_matching_function 6 assembler instructions 13th International Workshop on Learning Classifier Systems - Gilles Enée (gilles.enee@univ-ag.fr)

  6. Logic 13th International Workshop on Learning Classifier Systems - Gilles Enée (gilles.enee@univ-ag.fr)

  7. Logic Deduced from previous table • IsMatching(pos) when ¬(condition[pos] ⊕ inputs[pos]) Using C / C++ language • IsMatching(pos) when ((condition[pos]⊕inputs[pos]) ≠1) Simplifying • IsMatching(pos) when ((condition[pos]⊕inputs[pos])−1) 13th International Workshop on Learning Classifier Systems - Gilles Enée (gilles.enee@univ-ag.fr)

  8. Logic (condition[pos] ⊕ inputs[pos]) 13th International Workshop on Learning Classifier Systems - Gilles Enée (gilles.enee@univ-ag.fr)

  9. Logic Let’s suppose that R[1] contains condition[pos], R[2] inputs[pos] • IsMatching(pos) when ((condition[pos]⊕inputs[pos])−1) Will be written in assembler • Xor R[3], R[1], R[2] • Cmpi R[4], R[3], 1 • Jeq R[4], end_matching_function 3 assembler instructions 13th International Workshop on Learning Classifier Systems - Gilles Enée (gilles.enee@univ-ag.fr)

  10. ExperimentationsPure Matching Hardware and Software • Intel Core 2 Duo 3 Ghz • 2 Gb • Gcc 4.4.1 –O3 • Ubuntu 64 bits • /usr/bin/time -f “%U” 13th International Workshop on Learning Classifier Systems - Gilles Enée (gilles.enee@univ-ag.fr)

  11. ExperimentationsPure Matching • Classifier condition • Length is 10, 50, 100 bits • Filled with : 0%, 50% and 100% of wildcard • Size of rule that matches : 0%, 1%, 5%, 10%, 15%, 20%, 25%, 50%, 75% and 100% • Repeated : 107 times 13th International Workshop on Learning Classifier Systems - Gilles Enée (gilles.enee@univ-ag.fr)

  12. ExperimentationsPure Matching Wildcard Rate is 0% 13th International Workshop on Learning Classifier Systems - Gilles Enée (gilles.enee@univ-ag.fr)

  13. ExperimentationsPure Matching Closer look to 0% with length = 100 bits 13th International Workshop on Learning Classifier Systems - Gilles Enée (gilles.enee@univ-ag.fr)

  14. ExperimentationsPure Matching Why ? Assembler code gives answer • Or • Cmpi R[3], R[1],’#’ • Jeq R[3], end_match_test • Cmp R[3], R[1], R[2] • Jeq R[3], end_match_test • Cmpi R[3], R[2], ‘#’ • Jne R[3], end_matching_function • Xor • Xor R[3], R[1], R[2] • Cmpi R[4], R[3], 1 • Jeq R[4], end_matching_function 13th International Workshop on Learning Classifier Systems - Gilles Enée (gilles.enee@univ-ag.fr)

  15. ExperimentationsPure Matching Wildcard Rate is 50% 13th International Workshop on Learning Classifier Systems - Gilles Enée (gilles.enee@univ-ag.fr)

  16. ExperimentationsPure Matching Why Xor is that much better ? • 50% of the time boolean test works with ‘#’ • 50% of the time boolean test works with == • Processor optimizations , thanks to Branch Unit, reaches their limits 13th International Workshop on Learning Classifier Systems - Gilles Enée (gilles.enee@univ-ag.fr)

  17. ExperimentationsPure Matching Wildcard Rate is 100% 13th International Workshop on Learning Classifier Systems - Gilles Enée (gilles.enee@univ-ag.fr)

  18. ExperimentationsPure Matching Why Or is better then ? • Branch Unit statistically detects that the test with wildcard should be run more often • The longer is your condition part, the more CPU opimizes this 13th International Workshop on Learning Classifier Systems - Gilles Enée (gilles.enee@univ-ag.fr)

  19. ExperimentationsPure Matching But we don’t have exactly 100% in condition part of learnt classifiers so ? • Some experimentations made with ggc 3.3 on JS21 blades (RISC architecture) with 2 Gbytes per core 13th International Workshop on Learning Classifier Systems - Gilles Enée (gilles.enee@univ-ag.fr)

  20. ExperimentationsPure Matching 13th International Workshop on Learning Classifier Systems - Gilles Enée (gilles.enee@univ-ag.fr)

  21. Experimentations Summarize • Xor better for character based matching ? • Globally yes • Depends heavilly upon • CPU (RISC or CISC) • Compiler (dedicated or version) • Order of your tests with Or version • Wildcard rate • Size of your condition part 13th International Workshop on Learning Classifier Systems - Gilles Enée (gilles.enee@univ-ag.fr)

  22. ExperimentationsXCS and APCS Hardware and Software • Intel Core 2 Duo 2,2 Ghz • 2 Gb • Gcc 4.4.3 with –g –O1 –O2 and –O3 • Ubuntu 64 bits • /usr/bin/time -f “%U” • 10 experimentations each • XCS tested with M Tuberculosis database (Valetudie and al. 2007) • APCS tested with small Yin Yang ball 13th International Workshop on Learning Classifier Systems - Gilles Enée (gilles.enee@univ-ag.fr)

  23. ExperimentationsXCS and APCS XCS results 13th International Workshop on Learning Classifier Systems - Gilles Enée (gilles.enee@univ-ag.fr)

  24. ExperimentationsXCS and APCS APCS results 13th International Workshop on Learning Classifier Systems - Gilles Enée (gilles.enee@univ-ag.fr)

  25. ExperimentationsXCS and APCS Explanations for APCS 13th International Workshop on Learning Classifier Systems - Gilles Enée (gilles.enee@univ-ag.fr)

  26. Conclusion Is it worth to change Character-Based matching algorithm with Xor ? • Yes • You simplify testing ternary bits moreover if you can have wildcards in incoming signal like in classifications cases • Your code pass through –O3 optimization :) • 2% can be crucial when dealing with a lot of datas • Maybe not • If you don’t need to test wildcards in signals : testing has to be done to be fair 13th International Workshop on Learning Classifier Systems - Gilles Enée (gilles.enee@univ-ag.fr)

  27. Conclusion Thanks for your attention 13th International Workshop on Learning Classifier Systems - Gilles Enée (gilles.enee@univ-ag.fr)

More Related