Git Product home page Git Product logo

fsm-learning's Introduction

FSM Learning

This repository hosts code accompanying Learning Moore Machines from Input-Output Traces and related publications.

Fork!

This project was forked to be used in the research into database assisted state machine learning. (TODO add those links when published.)

This fork contains changes so that it works on Linux by using the JSON interfaces and not the binary interfaces.

It also comes with a script to convert the moore traces to abbadingo traces. Random end points are chosen from the Moore trace. See moore2trace.py for how this works.

Usage:

./generate --mid out/fsmtest_200_1.json --tid /dev/stdout --rs 222 --sz 1000000000 | python moore2trace.py | head -n 1040000 > out/fsmtest_200_222.dat

A very large --sz is set to keep continuing making data until enough lines are made and closing the pipe.

There is also a branch no-uniform-sampling which enhances the gen_moore.py script to give each transition a weight and a modified generate_impl.d file which uses these weight to generate traces that have a non-uniform distribution on what transitions it is using. (The old version deliberately tried to make the distribution as uniform as possible by keeping track of the frequenceies of the visisted nodes.)

Prerequisites

In order to run the random and benchmark Moore machine learning experiments presented in the paper, you will need a D compiler (dmd or ldc should be fine), as well as a Python 2.7 interpreter (this is temporary though -- we are in the process of porting all Python code to D). In order to run the performance comparison experiments you will also need LearnLib, flexfringe and their dependencies.

We ran all experiments on 64 bit Windows (it is possible to compile flexfringe under Cygwin with very little effort), but it should be possible to run everything on Linux or OS X without much modification. We used dmd 2.086.0 for the random and benchmark learning experiments and ldc 1.15.0 for the performance comparison experiments.

How to...

Run the random Moore machine learning experiments

$ dmd -m64 -i -O -release -inline -boundscheck=off generate.d

$ dmd -m64 -i -O -release -inline -boundscheck=off run_rand_fsm_experiments.d

$ run_rand_fsm_experiments.exe

Results will be stored in o/all-results.txt. Note that the process stops when detecting high memory usage and you have to restart it (all results are cached -- no experiment is repeated).

Run the benchmark Moore machine learning experiments

$ dmd -m64 -i -O -release -inline -boundscheck=off generate.d

$ dmd -m64 -i -O -release -inline -boundscheck=off run_real_fsm_experiments.d

$ run_real_fsm_experiments.exe

Results will be stored in o2/all-results.txt

Run the performance comparison experiments

MealyMI

$ ldmd2 -m64 -i -O -release -inline -boundscheck=off mealy_learn_opt.d

$ mealy_learn_opt.exe perfcomp/train30ff.txt 3 ff

LearnLib

  • Set up a new maven project following the instructions here. For convenience we provide a pom file which also includes the shade plugin, required to bundle everything into a single jar (see perfcomp/pom.xml).

  • As the source code for the project use the provided perfcomp/ExampleMealy.java (edit to make sure the correct path is used for the training set).

  • Build and run the project:

$ mvn package

$ java -cp path/to/project.jar org.example.learnlib.ExampleMealy

flexfringe

  • Checkout commit b44cfadf0a28530dd8da72cef439a8fe0f96b462 from here

  • Before building you may want to...

    • comment out print statements inside random_greedy_bounded_run (random_greedy.cpp) and get_possible_refinements (state_merger.cpp)

    • measure execution time of id.read_abbadingo_file(input_stream); (main.cpp), id.add_data_to_apta(the_apta); (main.cpp), and random_greedy_bounded_run(&merger); (dfasat.cpp) using e.g. this

  • Build it following the instructions in the repository

    • Note that to build on Windows under Cygwin, you may need to change -std=c++11 to -std=gnu++11 in the makefile.
  • Run it using the perfcomp/batch-mealy.ini file we provide:

$ ./start.sh batch-mealy.ini path/to/train30ff

More examples & documentation

Coming soon, stay tuned...

fsm-learning's People

Contributors

ggiorikas avatar hwalinga avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.