Giter VIP home page Giter VIP logo

rgep's Introduction

RGEP

This is an implementation of Robust Gene Expression Programming (RGEP). This algorithm was described in "Robust Gene Expression Programming: Treeless Expression Trees", my master's thesis.

During grad school, I implemented this algorithm in Haskell. This implementation is in Rust, making use of some similar ideas but starting fresh. I now prefer the determinism of Rust, so I wanted to have this algorithm implemented in a fairly fast way so I could experiment with it and Genetic Algorithms.

There is not likely much to see here, unless you are interested in RGEP or Gene Expression Programming, which is quite cool. There is a fast implementation of Point Mutation that could be used in other Genetic Algorithm code.

This software is licensed under MIT and Apache 2, whichever you prefer.

rgep's People

Contributors

nsmryan avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

feeeengym

rgep's Issues

Graph/Automata Domain

It would be cool to have an "evaluation domain" (a built-in problem domain that RGEP can solve) for graphs and/or finite state machines.

This could end up like Haskell alga, the graph algebra library, or might take another direction. In the paper describing algebraic graphs there is a note at the end about state machines as maps from symbols to graphs that might help.

RGEP Example

Move the code that is currently in main into one or more examples to clean up the repo

Algorithms should have a Stage

GA and RGEP should expose a stage version and a "final" version.

This way they can be woven into other algorithms as a unit.

Generic DNA Types

Currently individuals are vectors of u8. It would be nice to allow any type, and have RGEP specialize to u8.
Most operators should generalize easily, but some may require the more specialized types.

This may be as easy as making Ind = Ind(Vec).

Split Algorithms Into Modules

GA and RGEP should be in separate modules, and RGEP should depend on GA, or they both depend on generic functions.

This would make it easier to add other algorithms like PBIL, and should help with variants of RGEP.

Immutable Testing

Performance testing with immutable structures and single traversal of data.

Either find a way to combine mutation and crossover, or have each operation output a description of what it wants to do (dense update, sparse update, move block) and treat the whole population as a single tree.
Specialize for a GA at first, generate the movements desired, and resolve what needs to happen. Then just go through the population once, doing O(n) splits taking O(ln(n)) time and joins taking O(ln(n)) time.
Do performance testing against the other RGEP implementations to see if the cache behavior helps enough to make this worth it.

Packaging for Release

What would need to happen to release this library?

  1. RGEP function
  2. RGEP examples for several domains
  3. GA function
  4. GA examples
  5. Parallel execution- all EA seem to include this
  6. Documentation on exposed functions
  7. Example of building new algorithms
  8. More generic functions (some use u8 explicitly)
  9. Some level of benchmarking
  10. Documentation for rustdoc

RGEP Paper Modifications

It would be very cool to implement the changes to RGEP in the one referencing paper.

I would have to find the paper again, but the changes should be straightforward.

Runners

Add a concept of runners as StageTranformers, taking a stage and returning a stage.

There should at least be a runner for evaluating N times, and for evaluating a predicate on the state.

Look at Returning State

Look into having the algorithm functions (GA and RGEP) return their state structure instead of just the population. This would supply the user with fitness values as well.

If this is not useful, consider a separate structure to return, perhaps with expressed individuals.

Modulalization

The genetic operators are currently in the root src directory. They should be separated into an operators directory, perhaps with sub directories for each operator and separate files for each implementation of each operator.

Parallelize Genetic Operators

Genetic operators should be able to run in parallel- at least within an operator, if not also in a pipeline.

The easiest way to do this might be to make the operators iterators, and use Rayon.

Add Evaluation Domains

It seems like the RGEP evaluation domains (tree, arithmetic, decision tree, etc) should be in a separate module to isolate them from the main algorithm code.

The domains that come to mind are:

  • simple arithmetic
  • decision trees
  • symbol trees (sexpr)
  • boolean circuits
  • sequence manipulation (swap, rot, dup, etc)
  • virtual machine instructions

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.