Python Documentation

Utilities

Assorted functionalities.

Kernels

dCGP kernels

Kernels, (also called non-linearities in the ANN literature) describe the fundamental computational units of a CGP. Things like addition, multiplication, trigonomoetric functions are all kernels. The classes dcgpy.kernel_double, dcgpy.kernel_gdual_double and dcgpy.kernel_gdual_vdouble allow the user the definition of their own kernels able to operate on the choosen type.

The most popular kernels are already coded and shipped with dcgpy. A python list containing multiple kernels can be easily instantiated via the classes dcgpy.kernel_set_double, dcgpy.kernel_set_gdual_double and dcgpy.kernel_set_gdual_vdouble.


Types of dCGPs

Several types of Cartesian Genetic Program are provided in dcgpy. Since a dCGP is some kind of a mathematical expression, we use the term expression to name the related, different, classes.

We essentially provide three types of CGPs:

  • expression: this is the original CGP as introduced by Miller in 1999.

  • expression_weighted: this adds to the original CGP formulation weights on each of the graph edges. (original with dCGP - 2016)

  • expression_ann: this represents an Artificial Neural Network inclusive of biases and weights, via a CGP and allows to learn the model parameters using backproagation. (original with dCGP - 2018)

Each of the above CGPs can operate over different numerical types. For example an expression can operate over floats (dcgpy.expression_double), in which case the result of evaluating the inner computational graph will be a float, but also on gduals (dcgpy.expression_gdual_double), in which case, the result of evaluating the inner computational graph will be a gdual (hence it will contain all the program derivatives up to the chosen order and hence is referred to as a dCGP.)

Another important type some CGPs can operate upon is the vectorized gdual (dcgpy.expression_gdual_vdoubles). This type is the same as the gdual type, but its vectorized, allowing order of magnitude speed ups when a CGP needs to be evaluated over several points (such as in the case of a loss evaluation)


Symbolic Regression

non-linear regression

Mathematically, a symbolic regression problem is a global optimization problem. In order to facilitate its solution, a number of classes have been designed to interface a dcgpy expression to the optimisation suite pygmo. In particular we provide UDPs (in pagmo’s jargon user defined problems) that can be used to build pygmo.problem objects (representing symbolic regression problems) and UDAs (in pagmo’s jargon user defined algorithms) that can be used to build pygmo.algorithm objects.

We also make available, as a gym to test the capabilities of various proposed methodologies, a number of data sets coming from different scientific sources. These are collected in what we call the dcgpy gym.