Non-dominated sorting genetic algorithm (NSGA-III) with Machine Learning Surrogate

adjoint - gradient based optimization

class glennopt.optimizers.nsga3_ml.NSGA3_ML(eval_command: str = 'python evaluation.py', eval_folder: str = 'Evaluation', optimization_folder: Optional[str] = None, single_folder_eval: bool = False, overwrite_input_file: bool = False, linear_network: List[int] = [64, 64, 64, 64], epochs: int = 100, train_test_split: float = 0.8, pop_size: int = 32, ml_evals: int = 5)[source]
__crossover_mutate__(individuals: List[Individual])[source]

[summary]

Parameters

individuals (List[Individual]) – [description]

Returns

[description]

Return type

[type]

add_eval_parameters(eval_params: List[Parameter])[source]

Add evaluation parameters. This is part of the initialization

Parameters

eval_params (List[Parameter]) – Add in a list of evaluation parameters

add_objectives(objectives: List[Parameter])[source]

Add the objectives

Parameters

objectives (List[Parameter]) – [description]

add_performance_parameters(performance_params: Optional[List[Parameter]] = None)[source]

Add performance parameters

Parameters

performance_params (List[Parameter], optional) – [description]. Defaults to None.

property mutation_params

Get Mutation parameters

Returns

parameter class describes the mutation

Return type

mutation_parameters

optimize_from_population(pop_start: int, n_generations: int)[source]

Reads the values of a population, this can be a DOE or a previous evaluation Starts the optimization

Inputs:

pop_start (-1 for DOE), reads the population folder and starts at pop_start+1 n_generations - number of generations to run for

start_doe(doe_individuals: Optional[List[Individual]] = None, doe_size: int = 128)[source]

Starts a design of experiments. This generates the parameters for the individuals to be evaluated and executes each case. If the DOE has already started and there is an output file for an individual then the individual won’t be evaluated

Parameters
  • doe_individuals (List[Individual], optional) – List of individuals. Defaults to None.

  • doe_size (int, optional) – [description]. Defaults to 128.

train(individuals: List[Individual], retrain: bool = False) Tuple[float, float][source]

Trains the neural network to predict the output given an input

Optimizer (LBFGS):

https://johaupt.github.io/python/pytorch/neural%20network/optimization/pytorch_lbfgs.html

Parameters
  • individuals (List[Individual]) – [description]

  • retrain (bool, Optional) – (True) retrains the existing model on new data. (False) create a new model

Returns

Train Loss and test loss

Return type

Tuple[float float]