Git Product home page Git Product logo

ga-clj's Introduction

GA-CLJ

A genetic algorithm framework in Clojure that makes minimal assumptions.

Rationale

@todo write me!

Outline

  • prior art
    • Clojush, Propeller, link to lspector Conj talk. Maybe link to famous PushGP uses (quantum, finite algebra)
      • Coupled to PushGP.
    • Other JVM tools: ECJ, jenetics, etc.
      • Other tools make assumptions about genome/phenome structures.
      • Not easily extended via interop.
  • Decoupling from assumptions
    • Genomes can be any data.
    • Individuals are open maps that hold genomes, errors, and anything else the user wants to add to them.
    • "breeding" new genomes is done via a user supplied function.
  • Solving common issues
    • Ensure same, well tested, implementations of common algorithms. (aka toolbox)
    • Difficult to debug evolution because it is random.
      • GA-CLJ enhances exceptions with additional data (for example, the genome that caused the problem.)

Installation

We recommend declaring your ga-clj dependency using git coordinates. Add the following to your deps.edn.

;; Add to 
{io.github.erp12/ga-clj {:git/tag "v0.0.2" :git/sha "e3c764dg"}}

In the future, we may also publish releases to Clojars.

Guide

Currently, ga-clj only supports generational genetic algorithms.

Terminology

  • genome-factory: A nullary function for creating random genomes.
  • genome->individual: A function from genome to an "individual" map containing additional data used to drive breeding. Often this map contains the errors/fitness associated with the genome but could also contain any other values.
  • breed: A function that takes the current population of individuals and maybe other data about the state of evolution and returns a new child genome. Often this function will perform parent selection and variation operators. The erp12.ga-clj.toolbox namespace provides implementations of commonly used algorithms that will likely be useful to call in breed functions.

Additional terminology and configuration parameters can be found in the docstring of evolve functions found in namespaces that provide a specific kind of genetic algorithm. For example:

  • erp12.ga-clj.generational/evolve

Examples

See the examples/ directory. You can run the examples on the command line. For example:

clj -M:examples -m erp12.ga-clj.examples.alphabet

Change the namespace in the command to run a different example.

Contributing

See the CONTRIBUTING.md for more information, including how to run tests.

To-Do before "official" release

  • Fill out the toolbox with other common error functions, selection methods, and variation operators.
  • Add more examples that test the design/abstraction in a wider range of scenarios.
    • TSP?
    • Knapsack problem?
  • Rationale and Guide

ga-clj's People

Contributors

erp12 avatar kitan23 avatar thelmuth avatar

Stargazers

 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.