Giter VIP home page Giter VIP logo

arnold's Introduction

ARNOLD

An implementation of the ARNOLD algorithm for learning polynomial constraints from positive data.

Requirements

  • scipy
  • numpy
  • math
  • itertools
  • copy
  • argparse
  • csv

Requirements for Experiments

Installation

Install all the packages mentioned above, unzip the code in any directory with write permissions and you should be able to run the code.

How to learn constraints

To learn constraint call run.py with the following arguments:

  1. --num_sum
  2. --num_prod
  3. --negation
  4. --negZ <should <= inequality be considered>
  5. --folder
  6. --file_name
  7. --example (use multiple times to input multiple examples)
  8. --input_var
  9. --var

Most of the input arguments have a default value in the code.

Here is one example to call run.py: python run.py --var W F demand production ship --input_var W F demand production --example W=4 F=3 demand=[30,20,35,20] production=[40,40,25] ship=[[15,0,16,9],[0,20,9,11],[15,0,10,0]]

It will create a minizinc file in the specified folder or the location of the code if not specified.

How to run experiments

Currently the implementation is in the experiment mode. Given any minizinc file as an input, the algorithm samples some examples and learns a model which is then written in a minizinc file. To run an experiment follow these steps:

  1. Make sure there is a folder inside "experiments/" with the name of the problem, for example shipping.
  2. Inside shipping folder, there should be 3 files:
    • "shipping.mzn" : this is the model we try to learn
    • "shipping.mzn.vars" : this contains the name of all the variables and constants in the model
    • "shipping.mzn.inputvars" : this contains the name of all the constants in the model (Please have a look at some of the folders which has already been put there to run experiments)
  3. Now to run experiments for a particual problem simply call "experiment.py" with the following arguments: --file --sum --prod

One example to run an existing problem in the experiment would be to run the following command:

python experiment.py --file shipping --sum 1 --prod 1 2 3

This command will run the experiments for shippping problem be fixing number of terms to 1 and varying the number of variables in each term. It will generate the results of the experiment with values on recall, precision and time inside "experiments/shipping/results/". The resulted minizinc file for each experiment is stored in "experiments/shipping/minizinc/"

Authors

Mohit Kumar < mohit dot kumar at cs dot kuleuven dot be >

arnold's People

Contributors

mohitkr avatar

Stargazers

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