Giter Site home page Giter Site logo

jalergia's Introduction

jAlergia - Alergia passive automaton learning

jAlergia is minimal, modular, and efficient implementation of ALERGIA automaton learning algorithm in Java. It is developed without any dependencies and can be used either with your code, from command line, or from Python.

Learned models are saved in the .dot format and can be visualized with graphviz and used with AALpy. AALpy also includes python bindings to jAlergia .jar file.

jAlergia supports passive learning of

Passive Learning Process

Usage

Command line

# Compile your own jar or download it from the repo
git clone https://github.com/emuskardin/jAlergia
gradlew jar
# gradlew.bat on Windows
java -jar alergia.jar -help
java -jar alergia.jar -input .\sampleFiles\mdpData1.txt -type mdp
# in case you run out of memory during FPTA construction
# - exten JVM memory with -Xmx, eg. -Xmx12g 
# - and/or set -optim to 'mem'

Code

class AlergiaExample {
    public static void main() {
        String path = "sampleFiles/mdpData2.txt";
        double eps = 0.005;
        ModelType type = ModelType.MDP;
        String saveLocation = "jAlergiaModel";
        OptimizeFor optimizeFor = OptimizeFor.ACCURACY;

        List<List<String>> data = Parser.parseFile(path);
        Alergia a = new Alergia();
        a.runAlergia(data, type, eps, optimizeFor);
    }
}

Integration with AALpy

Model learned by jAlergia can be loaded and visualized by AALpy, an open source active automata learning library written in Python.

from aalpy.learning_algs import run_JAlergia
from aalpy.utils import visualize_automaton

model = run_JAlergia(path_to_data_file='/sampleFiles/mdpData1.txt.txt', automaton_type='mdp', eps=0.005,
                     path_to_jAlergia_jar='alergia.jar')

visualize_automaton(model)

Input file syntax

Input files should follow the same syntax as defined in AALpy's Wiki. Following is the example of MDP input file. Note that numbers indicate inputs and capital character outputs.

C,0,A,1,A,0,B,1,C,1,A,1,C,0,D,0,C,0,A,1,C,1,A,1,C
C,1,B,0,C,1,A,0,B,0,C,0,D,0,C,1,A
C,0,A,1,A,1,A,0,B,0,C,1,A,1,C,0,D,0,C,1,B
C,1,B,1,D,1,C,0,D,0,C,0,A,1,C,1,C,0,D,1,C
...

Following the same logic, Markov chain input files would be sequences of inputs:

1,2,3,4,1,2,3,15,1,2,4
1,3,4,2,2,1,5,7,2,5
1,7,4,7,2,9,4,2,8,5
...

Stochastic Mealy machine input files follow the same syntax as MDP input file, just without the initial output.

Cite jAlergia and Research Contact

jAlergia is a twin implementation of AALpy's Alergia implementation, and it is maintained as a part of the please cite: AALpy library. If you use jAlergia in the research context, please cite:

@inproceedings{aalpy,
	title = {{AALpy}: An Active Automata Learning Library},
	author = {Edi Mu\v{s}kardin and Bernhard K. Aichernig and Ingo Pill and Andrea Pferscher and Martin Tappler},
	booktitle = {Automated Technology for Verification and Analysis - 19th International
	Symposium, {ATVA} 2021, Gold Coast, Australia, October 18-22, 2021, Proceedings},
	series    = {Lecture Notes in Computer Science},  
	publisher = {Springer},
	year      = {2021},
}

If you have research suggestions, or you need specific help concerning your research, feel free to start a discussion or contact [email protected]. I am happy to help you and consult you in applying automata learning in various domains.

jalergia's People

Contributors

emuskardin avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.