Git Product home page Git Product logo

hassle-gen-1's Introduction

HASSLE-GEN

This repository contains the code for our paper: Senne Berden, Mohit Kumar, Samuel Kolb, and Tias Guns (2022): Learning MAX-SAT Models from Examples using Genetic Algorithms and Knowledge Compilation, CP 2022

Overview of the code

The code is structured as follows:

├── __init__.py
├── examples                      # Directory containing some examples that illustrate how to start a run of HASSLE-SLS or HASSLE-GEN
├── experiments                   # Directory containing the experiments that made it into the paper, along with the associated data and results
├── hassle_sls                    # Directory containing the code associated with HASSLE-SLS (also see https://github.com/mohitKULeuven/HassleWithLocalSearch)
├── tests                         # Directory containing tests
├── auxiliary.py                  # Auxiliary functions that get called from various places
├── crossover.py                  # Various crossover operators
├── evaluation.py                 # Code related to the evaluation of MAX-SAT models
├── generation_script             # Example Bash script illustrating how to generate synthetic learning problems and target models
├── generator.py                  # Auxiliary code for the generation of synthetic learning problems and target models
├── genetic.py                    # General GeneticAlgorithm class for the learning of MAX-SAT models from labeled examples
├── hassle_gen.py                 # The HassleGen class, a subclass of GeneticAlgorithm, that contains the high-level HASSLE-GEN loop (Algorithm 2 in the paper) 
├── knowledge_compilation.py      # Code related to the use of knowledge-compilation in the evaluation of MAX-SAT models. Used in evaluation.py
├── learn_max_sat_model.py        # Auxiliary layer between experiment files and hassle_gen.py. Constructs, configures and runs an instance of the HassleGen class based on provided hyperparameters
├── mutation.py                   # Various mutation operators
├── observe.py                    # Code for Observers, which, when along to a run of HASSLE-SLS or HASSLE-GEN, keep track of various statistics throughout the iterations/generations. Useful for plotting
├── plotting.py                   # Code that takes (collections of) observers and generates various kinds of plots
├── reporting.py                  # Code that takes (collections of) observers and generates a report as a CSV file 
└── synthetic.py                  # Auxiliary layer between generation_script and generator.py. Takes command line input and calls the appropriate code from generator.py

Using the code

The examples and experiments come equipped with training data and target models (as pickle files) and can be ran directly.

To create custom learning problems, first alter the generation_script file as desired, and then execute it using the bash generation_script command. This creates a directory named pickles in the project's top-level directory. To use the generated learning problem(s) in an example or an experiment, replace the contents of the example's or experiment's pickles folder with the contents of the newly created top-level pickles folder.

hassle-gen-1's People

Contributors

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