Kernel
kernel_double
- class dcgpy.kernel_double(callable_f, callable_s, name)
The function defining the generic CGP node
Constructs a kernel function from callables.
- Parameters
callable_f (
callable - List[double] -> double
) – a callable taking a list of double as inputs and returning a double (the value of the kernel function evaluated on the inputs)callable_s (
callable - List[string] -> string
) – a callable taking a list of string as inputs and returning a string (the symbolic representation of the kernel function evaluated on the input symbols)name (
string
) – name of the kernel
Examples:
>>> from dcgpy import * >>> def my_sum(x): ... return sum(x) >>> def print_my_sum(x): ... s = "+" ... return "(" + s.join(x) + ") " >>> my_kernel = kernel_double(my_sum, print_my_sum, "my_sum")
kernel_gdual_double
- class dcgpy.kernel_gdual_double(callable_f, callable_s, name)
The function defining the generic CGP node
Constructs a kernel function from callables.
- Parameters
callable_f (
callable - List[gdual_double] -> gdual_double
) – a callable taking a list of gdual_double as inputs and returning a gdual_double (the value of the kernel function evaluated on the inputs)callable_s (
callable - List[string] -> string
) – a callable taking a list of string as inputs and returning a string (the symbolic representation of the kernel function evaluated on the input symbols)name (
string
) – name of the kernel
Examples:
>>> from dcgpy import * >>> def my_sum(x): ... return sum(x) >>> def print_my_sum(x): ... s = "+" ... return "(" + s.join(x) + ") " >>> my_kernel = kernel_gdual_double(my_sum, print_my_sum, "my_sum")
kernel_gdual_vdouble
- class dcgpy.kernel_gdual_vdouble(callable_f, callable_s, name)
The function defining the generic CGP node
Constructs a kernel function from callables.
- Parameters
callable_f (
callable - List[gdual_vdouble] -> gdual_vdouble
) – a callable taking a list of gdual_vdouble as inputs and returning a gdual_vdouble (the value of the kernel function evaluated on the inputs)callable_s (
callable - List[string] -> string
) – a callable taking a list of string as inputs and returning a string (the symbolic representation of the kernel function evaluated on the input symbols)name (
string
) – name of the kernel
Examples:
>>> from dcgpy import * >>> def my_sum(x): ... return sum(x) >>> def print_my_sum(x): ... s = "+" ... return "(" + s.join(x) + ") " >>> my_kernel = kernel_gdual_vdouble(my_sum, print_my_sum, "my_sum")