Documentation for pdopt.optimisation

Module containing the functions and objects used in the Search phase.

pdopt.optimisation.Optimisation

Class for the object that performs the search within the surviving design sets. Keyword arguments that can be passed are the termination criteria hyperparmeters used in the pymoo library, along with the population size argument of the UNSGA3 algorithm.

Attributes:
  • design_space (DesignSpace) –

    The design space object of the problem.

  • model (Model) –

    Model object containing the evaluation function.

  • valid_sets_idx (list[int]) –

    List of the ids of the sets that were not discarded.

  • use_surrogate (bool) –

    If a surrogate model has been used in the search phase.

  • ref_dirs (ndarray) –

    Reference directions for NSGA3. See: https://pymoo.org/misc/reference_directions.html.

  • algorithm (UNSGA3) –

    The UNSGA3 Algorithm object.

  • termination (DefaultMultiObjectiveTermination) –

    The termination criterion used.

  • set_id (int) –

    id of the set which the problem is defined on.

  • x_mask (list[float]) –

    Mask to filter out the discrete paramters, as these are constant in the set and not modified by the optimiser.

  • l (list[float]) –

    Lower bounds of the continous input parameters.

  • u (list[float]) –

    Upper bounds of the continous input parameters.

pdopt.optimisation.Optimisation.__init__(design_space, model, save_history=False, use_surrogate=True, use_nn=False, gp_kern='matern', debug=False, **kwargs)

Initialise the Optimisation object.

Parameters:
  • design_space (DesignSpace) –

    The design space object of the problem.

  • model (Model) –

    Model object containing the evaluation function.

  • save_history (bool, default: False ) –

    Save history of the evolution. Defaults to False.

  • use_surrogate (bool, default: True ) –

    Use a surrogate model in the optimisation. Defaults to True.

  • use_nn (bool, default: False ) –

    If to use the neural network surrogate. Defaults to False.

  • gp_kern (str, default: 'matern' ) –

    Type of Gaussian Process kernel. Available modes are "matern" and "rbf". Defaults to "matern".

  • debug (bool, default: False ) –

    Fix the random generator seed for testing purposes. Defaults to False.

  • **kwargs

    Optional arguments for introducing termination criteria.

Returns:
  • None.

pdopt.optimisation.Optimisation.run(folder=None)

Run the search phase.

Parameters:
  • folder (str, default: None ) –

    Path where to save temporarely the DesignSpace object between set optimisation runs. Defaults to None.

Returns:
  • None.

pdopt.optimisation.NNSurrogate

Bases: Problem

Class that represents a deterministic optimisation problem, using a neural-network surrogate model for function evaluation. It is locally trained before use on the DesignSet it is part of. This class wraps the pymoo.core.problem.Problem class.

Attributes:
  • design_space (DesignSpace) –

    The design space object of the problem.

  • var (list[Parameter]) –

    List containing the input parameter objects.

  • obj (list[Objective]) –

    List containing the objective objects.

  • cst (list[Constraint]) –

    List containing the constraint objects.

  • model (Model) –

    Model object containing the evaluation function.

  • set_id (int) –

    id of the set which the problem is defined on.

  • x_mask (list[float]) –

    Mask to filter out the discrete paramters, as these are constant in the set and not modified by the optimiser.

  • l (list[float]) –

    Lower bounds of the continous input parameters.

  • u (list[float]) –

    Upper bounds of the continous input parameters.

pdopt.optimisation.NNSurrogate.__init__(model, design_space, set_id, debug=False, **kwargs)

Initialise the NeuralNetwork Surrogate optimisation problem object.

Parameters:
  • model (Model) –

    Model object containing the evaluation function.

  • design_space (DesignSpace) –

    The design space object of the problem.

  • set_id (int) –

    id of the set which the problem is defined on.

  • debug (bool, default: False ) –

    Fix the random generator seed for testing purposes. Defaults to False.

Returns:
  • None.

pdopt.optimisation.NNSurrogate.recover_pts(X)

Reconstruct the true output from the evaluation function of the optimal points X.

Parameters:
  • X (ndarray) –

    Input values to be evaluated.

Returns:
  • numpy.ndarray: Array containing the input values with the true objective and constraint values.

pdopt.optimisation.NNSurrogate.sample()

Sample to train the surrogate model.

Returns:
  • None.

pdopt.optimisation.NNSurrogate.train_model()

Train the surrogate model.

Returns:
  • None.

pdopt.optimisation.KrigingSurrogate

Bases: Problem

Class that represents a deterministic optimisation problem, using a Kriging surrogate model for function evaluation. It is locally trained before use on the DesignSet it is part of. This class wraps the pymoo.core.problem.Problem class.

Attributes:
  • design_space (DesignSpace) –

    The design space object of the problem.

  • var (list[Parameter]) –

    List containing the input parameter objects.

  • obj (list[Objective]) –

    List containing the objective objects.

  • cst (list[Constraint]) –

    List containing the constraint objects.

  • model (Model) –

    Model object containing the evaluation function.

  • set_id (int) –

    id of the set which the problem is defined on.

  • kernel (str) –

    Type of Gaussian Process kernel.

  • x_mask (list[float]) –

    Mask to filter out the discrete paramters, as these are constant in the set and not modified by the optimiser.

  • l (list[float]) –

    Lower bounds of the continous input parameters.

  • u (list[float]) –

    Upper bounds of the continous input parameters.

pdopt.optimisation.KrigingSurrogate.__init__(model, design_space, set_id, kernel, debug=False, **kwargs)

Initialise the Kriging Surrogate optimisation problem.

Parameters:
  • model (Model) –

    Model object containing the evaluation function.

  • design_space (DesignSpace) –

    The design space object of the problem.

  • set_id (int) –

    id of the set which the problem is defined on.

  • kernel (str) –

    Type of Gaussian Process kernel.

  • debug (bool, default: False ) –

    Fix the random generator seed for testing purposes. Defaults to False.

Returns:
  • None.

pdopt.optimisation.KrigingSurrogate.recover_pts(X)

Reconstruct the true output from the evaluation function of the optimal points X.

Parameters:
  • X (ndarray) –

    Input values to be evaluated.

Returns:
  • numpy.ndarray: Array containing the input values with the true objective and constraint values.

pdopt.optimisation.KrigingSurrogate.sample()

Sample to train the surrogate model.

Returns:
  • None.

pdopt.optimisation.KrigingSurrogate.train_model()

Train the surrogate model.

Returns:
  • None.

pdopt.optimisation.DirectOpt

Bases: Problem

Class that represents a deterministic optimisation problem, with direct function evaluation. This class wraps the pymoo.core.problem.Problem class.

Attributes:
  • design_space (DesignSpace) –

    The design space object of the problem.

  • var (list[Parameter]) –

    List containing the input parameter objects.

  • obj (list[Objective]) –

    List containing the objective objects.

  • cst (list[Constraint]) –

    List containing the constraint objects.

  • model (Model) –

    Model object containing the evaluation function.

  • set_id (int) –

    id of the set which the problem is defined on.

  • x_mask (list[float]) –

    Mask to filter out the discrete paramters, as these are constant in the set and not modified by the optimiser.

  • l (list[float]) –

    Lower bounds of the continous input parameters.

  • u (list[float]) –

    Upper bounds of the continous input parameters.

pdopt.optimisation.DirectOpt.__init__(model, design_space, set_id, **kwargs)

Initialise the DirectOpt optimisation problem object.

Parameters:
  • model (Model) –

    Model object containing the evaluation function.

  • design_space (DesignSpace) –

    The design space object of the problem.

  • set_id (int) –

    id of the set which the problem is defined on.

  • debug (bool) –

    Fix the random generator seed for testing purposes. Defaults to False.

Returns:
  • None.