loss_functions module¶
This module contains some basic implementations of simple fitness functions.
This module defines some basic fitness functions to use during the evolutionary process.
-
loss_functions.
L1
(x: Union[int, float]) → Union[int, float][source]¶ A basic implementation of the L1 norm.
This function computes the L1 norm between x and an objective_value defined through the configuration file.
- Parameters
x (float) – The value to evaluate. This is most likely the individual’s phenotype.
- Returns
The individual’s L1 error on the optimization task.
- Return type
fitness (float)
-
loss_functions.
MSE
(x: Union[int, float]) → Union[int, float][source]¶ A basic implementation of Mean Squared Error.
This function computes the Mean Squared Error between x and an objective_value defined through the configuration file.
- Parameters
x (float) – The value to evaluate. This is most likely the individual’s phenotype.
- Returns
- The individual’s Mean Squared Error on the optimization
task.
- Return type
fitness (float)
-
loss_functions.
Maximize
(x: Union[int, float]) → Union[int, float][source]¶ The fitness to use when trying to maximize a function.
This is the fitness to use in order to perform a maximization task. This is important so the evolution process can evaluate and compare individuals.
- Parameters
x (float) – The value to evaluate. This is most likely the individual’s phenotype.
- Returns
The individual’s fitness on the optimization task.
- Return type
x (float)
-
loss_functions.
Minimize
(x: Union[int, float]) → Union[int, float][source]¶ The fitness to use when trying to minimize a function.
This is the fitness to use in order to perform a minimization task. This is important so the evolution process can evaluate and compare individuals.
- Parameters
x (float) – The value to evaluate. This is most likely the individual’s phenotype.
- Returns
The individual’s fitness on the optimization task.
- Return type
x (float)