bingo.symbolic_regression.agraph.evaluation_backend package#

Submodules#

bingo.symbolic_regression.agraph.evaluation_backend.evaluation_backend module#

This module represents the python backend associated with the Agraph equation evaluation. This backend is used to perform the the evaluation of the equation represented by an AGraph. It can also perform derivatives.

bingo.symbolic_regression.agraph.evaluation_backend.evaluation_backend.evaluate(stack, x, constants)#

Evaluate an equation

Evaluate the equation associated with an Agraph, at the values x.

Parameters:
  • stack (Nx3 numpy array of int.) – The command stack associated with an equation. N is the number of commands in the stack.

  • x (MxD array of numeric.) – Values at which to evaluate the equations. D is the number of dimensions in x and M is the number of data points in x.

  • constants (list-like of numeric.) – numeric constants that are used in the equation

Returns:

:math`f(x)`

Return type:

Mx1 array of numeric

bingo.symbolic_regression.agraph.evaluation_backend.evaluation_backend.evaluate_with_derivative(stack, x, constants, wrt_param_x_or_c)#

Evaluate equation and take derivative

Evaluate the derivatives of the equation associated with an Agraph, at the values x.

Parameters:
  • stack (Nx3 numpy array of int.) – The command stack associated with an equation. N is the number of commands in the stack.

  • x (MxD array of numeric.) – Values at which to evaluate the equations. D is the number of dimensions in x and M is the number of data points in x.

  • constants (list-like of numeric.) – numeric constants that are used in the equation

  • wrt_param_x_or_c (boolean) – Take derivative with respect to x or constants. True signifies derivatives are wrt x. False signifies derivatives are wrt constants.

Returns:

Derivatives of all dimensions of x/constants at location x.

Return type:

MxD array of numeric or MxL array of numeric

bingo.symbolic_regression.agraph.evaluation_backend.operator_eval module#

This module provides the python implementation of the functions for each mathematical nodes used in Agraph

bingo.symbolic_regression.agraph.evaluation_backend.operator_eval.FORWARD_EVAL_MAP#

A map of node number to evaluation function

Type:

dictionary {int: function}

bingo.symbolic_regression.agraph.evaluation_backend.operator_eval.REVERSE_EVAL_MAP#

A map of node number to derivative evaluation function

Type:

dictionary {int: function}

bingo.symbolic_regression.agraph.evaluation_backend.operator_eval.forward_eval_function(node, param1, param2, x, constants, forward_eval)#

Performs calculation of one line of stack

bingo.symbolic_regression.agraph.evaluation_backend.operator_eval.reverse_eval_function(node, reverse_index, param1, param2, forward_eval, reverse_eval)#

Performs calculation of one line of stack for derivative calculation

Module contents#