metaheuristic_designer.benchmarks.img_funcs module#
- class ImgApprox(img_dim, reference, mode=None, img_name='', diff_func='MSE', name=None)[source]#
Bases:
ObjectiveFunc- Attributes:
paramsAccess parameter values by attribute-style lookup.
Methods
__call__(population)Shorthand for executing the objective function on a vector.
add_parameter_constraints(...)Attach extra constraint handlers for extended encodings (e.g., PSO).
calculate_fitness(population)Evaluate fitness for the whole population.
get_params()Return a copy of the current parameter dictionary.
get_state()Return a dictionary with the current configuration.
objective(solution)Implementation of the objective function.
repair_population(population)Transforms an invalid vector into one that satisfies the restrictions of the problem.
restart()Reset the evaluation counter to zero.
store_kwargs([progress])Store keyword arguments and evaluate them at the given progress.
update(progress)Re-evaluate all stored parameters at the current progress.
update_kwargs([progress])Add or replace parameters and immediately evaluate them.
- class ImgEntropy(img_dim, nbins=10, mode=None)[source]#
Bases:
ObjectiveFunc- Attributes:
paramsAccess parameter values by attribute-style lookup.
Methods
__call__(population)Shorthand for executing the objective function on a vector.
add_parameter_constraints(...)Attach extra constraint handlers for extended encodings (e.g., PSO).
calculate_fitness(population)Evaluate fitness for the whole population.
get_params()Return a copy of the current parameter dictionary.
get_state()Return a dictionary with the current configuration.
objective(solution)Implementation of the objective function.
repair_population(population)Transforms an invalid vector into one that satisfies the restrictions of the problem.
restart()Reset the evaluation counter to zero.
store_kwargs([progress])Store keyword arguments and evaluate them at the given progress.
update(progress)Re-evaluate all stored parameters at the current progress.
update_kwargs([progress])Add or replace parameters and immediately evaluate them.
- class ImgStd(img_dim, mode=None)[source]#
Bases:
ObjectiveFunc- Attributes:
paramsAccess parameter values by attribute-style lookup.
Methods
__call__(population)Shorthand for executing the objective function on a vector.
add_parameter_constraints(...)Attach extra constraint handlers for extended encodings (e.g., PSO).
calculate_fitness(population)Evaluate fitness for the whole population.
get_params()Return a copy of the current parameter dictionary.
get_state()Return a dictionary with the current configuration.
objective(solution)Implementation of the objective function.
repair_population(population)Transforms an invalid vector into one that satisfies the restrictions of the problem.
restart()Reset the evaluation counter to zero.
store_kwargs([progress])Store keyword arguments and evaluate them at the given progress.
update(progress)Re-evaluate all stored parameters at the current progress.
update_kwargs([progress])Add or replace parameters and immediately evaluate them.