program-induction
A library for program induction and learning representations.
Implements Bayesian program learning and genetic programming.
Installation
Install rust. In a new or existing project, add the
following to your Cargo.toml
:
[]
= "0.2"
# many examples also depend on polytype for the tp! and arrow! macros:
= "1.2"
Usage
Specify a probabilistic context-free grammar (PCFG; see pcfg::Grammar
) and
induce a sentence that matches an example:
extern crate polytype;
extern crate programinduction;
use ;
use ;
The Exploration-Compression (EC) algorithm iteratively learns a better
representation by finding common structure in induced programs. We can run
the EC algorithm with a polymorphically-typed lambda calculus representation
lambda::Language
in a Boolean circuit domain:
extern crate polytype;
extern crate programinduction;
use ;
You may have noted the above use of domains::circuits
. Some domains are
already implemented for you. Currently, this only consists of circuits and
strings. The strings domain uses a rich set of primitives and thus
depends on lambda::LispEvaluator
. If you find this evaluator to be slow,
you may install racket and enable the racket
feature in your Cargo.toml
:
[]
= "0.2"
= ["racket"]
See the documentation for more details.
Tips
For more on the Exploration-Compression algorithm, see Dechter, Eyal et al. "Bootstrap Learning via Modular Concept Discovery." IJCAI (2013). link
For more on genetic programming, see Poli, Riccardo et al. “A Field Guide to Genetic Programming.” (2008). link