liveBook · Manning

Gene expression programming

As explained in Evolutionary Deep Learning: Genetic algorithms and neural networks

Gene expression programming is an evolutionary method that develops mathematical expressions or functions represented by expression trees.

Gene expression programming (GEP) is an evolutionary technique for developing specific mathematical equations or functions. A chromosome encodes an expression tree rather than a fixed parameter vector: operators, constants, and inputs are placed in an order that defines how the resulting equation is evaluated. Fitness compares that equation’s output with a target, allowing selection and genetic variation to search for a better function. section 1.1.1 section 4.1.1

GEP is related to genetic programming (GP) and genetic algorithms (GAs), but its emphasis is mathematical expressions. GP can represent program logic or high-level functions; GEP represents an equation tree with a well-defined order of operations. This makes evolved candidates inspectable and potentially reusable as functions rather than opaque model approximations. section 1.1.1 section 4.1.1

A practical GEP setup defines the search space and evaluation loop:

  • Create a primitive set of input variables, arithmetic operators, and ephemeral constants; include protected division when invalid numerical results must be contained. section 12.1 section 4.1.1
  • Specify gene head length, chromosome gene count, and a linker for combining multiple genes into an individual. section 12.1
  • Compile each individual into a callable function, run it over sample inputs, and return an error-based fitness such as mean absolute error. section 12.1
  • Run evolutionary search with a population, generations, elites, mutation operators, and crossover operators; retain top candidates in a hall of fame. section 12.1
  • Simplify and visualize the best expression tree to inspect the equation that evolution produced. section 12.1

Evolving a linear equation

Given samples from f(x1) = 6 × x1 + 22, a Geppy search uses addition, subtraction, multiplication, protected division, and random constants to evolve a matching function. With a population of 100 over 100 generations, the simplified best individual is reported as 6*x1 + 22. section 12.1

Figure 4.1 Example GP individual to expression tree to equation to fitness

Trace how an ordered gene sequence becomes an uneven expression tree, an evaluable equation, and finally a fitness value. section 4.1.1

How Evolutionary Deep Learning: Genetic algorithms and neural networks covers it

How deep it goes
Explains expression-tree encoding, compilation, fitness evaluation, operators, chromosomes, and an executable evolutionary loop without formal derivations.
Examples
Uses multivariable symbolic regression and evolution of the target function 6*x1 + 22, then simplifies and visualizes the result.
What it assumes
Assumes familiarity with genetic algorithms and DEAP while introducing GEP-specific expression encoding and Geppy extensions.
What you can do after
Build it from scratch by configuring Geppy primitives, genes, operators, fitness evaluation, and an evolutionary run to produce readable functions.
How it connects
Connects genetic programming, genetic algorithms, regression, function approximation, deep learning, and generalized machine learning.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Evolutionary Deep Learning: Genetic algorithms and neural networks. The section links point to the parts of the book it draws on.