GithubHelp home page GithubHelp logo

dhananjayashok / lgga Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 2.0 2.14 MB

Learning Symbolic Equations with Auxiliary Truth Enhanced Genetic Algorithms

Home Page: https://dhananjayashok.github.io/LGGA/

Python 88.15% Shell 0.08% HTML 2.49% SCSS 9.28%

lgga's Introduction

Logic Guided Genetic Algorithms

This is our implementation of the Logic Guided Genetic Algorithm, a genetic algorithm for Symbolic Regression that combines logical constraints with the genetic programming life cycle to help avoid local minima and perform effective data set augmentation.

This code was written by Dhananjay Ashok, who is also the lead author on the paper on the same topic. The other authors of the paper are - Joseph Scott, Sebastian Wetzel, Maysum Panju and Vijay Ganesh

Prerequisites

  • Python 3.6+

Clone this repository:

git clone https://github.com/DhananjayAshok/Genetic-Algorithms-with-Logic-Guided-Machine-Learning LGGA
cd LGGA

Setup

Install required python packages, and create required directories:

bash setup.sh

Currently Supported Equations:

  • All Equations from the Feynman Equations Dataset
  • Pythogorean Formula
  • Parallel Resistance
  • Reflectivity
  • Coloumb's Law
  • Snell's Law
  • Gas Law
  • Distance
  • Normal Distribution

To add a new equation follow the steps below

  1. Create an initial data set of X, y in data/equation_id.csv (all columns must be X0, X1, ... target)
  2. Add any constraints relevant to the equation in Constraints.py (format and convinience functions can be found in Constraints.py)
  3. Add any data generation (lgml_func) function which may apply to the equation
  4. Add the equation and its details to a master File of your choosing (current master files include FeynmanEquations.csv, OtherEquations.csv)

To run the LGGA Tool on the new equation after set

  1. Create a Trainer object and specify which master file the equation is in
  2. Create a DEAPLearningSystem Object and specify which algorithm you wish to use (use lgml for the two algorithm found in the paper)
  3. Supply the constraint function and lgml functions to the DEAPLearningSystem via set_add_func and set_lgml_func
  4. Call on the Trainers predict_equations with the eq specified as required and specify use_gens to be False
  5. Result will be saved in DEAP_data by default
  6. Augmented Data Set will be saved in "Datasets/equation_id LGGA Dataset.csv"

Citation

If you use our work, please cite our paper. Will add link upon publication

License: CC BY-NC 4.0

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License. For any commercial uses or derivatives, please contact us.

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.