Surrogate optimizer
          Release 0.0.0
              Oct 06, 2020
                                                                                                      Contents:
1  app                                                                                                             1
   1.1 core package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  1
         1.1.1   Submodules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  1
         1.1.2   Module contents  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  8
   1.2 datamod package . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  8
         1.2.1   Submodules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  8
         1.2.2   Module contents  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
   1.3 metamod package . . . .    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
         1.3.1   Submodules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
         1.3.2   Module contents  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
   1.4 optimod package . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
         1.4.1   Submodules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
         1.4.2   Module contents  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
   1.5 run module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
   1.6 visumod package . . . . .  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
         1.6.1   Submodules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
         1.6.2   Module contents  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2  Indices and tables                                                                                             35
Python Module Index                                                                                               37
Index                                                                                                             39
                                                                                                                   i
ii
                                                          CHAPTER 1
                                                                app
1.1 core package
1.1.1 Submodules
core.model module
This modules sets up the overall properties of the model.
core.model.evaluators
      A dictionary of available evaluators.
            Type dict
class core.model.Model
      Bases: object
      This is the core class of the framework.
      evaluator
            The selected evaluator.
                 Type object
      range_in
            Input parameter allowable ranges.
                 Type np.array
      dim_in
            Number of input dimensions.
                 Type int
      dim_out
            Number of output dimensions.
                 Type int
                                                                   1
Surrogate optimizer, Release 0.0.0
     n_const
          Number of constraints.
               Type int
     n_obj
          Number of objectives.
               Type int
     Notes
     The ranges need to be specified if direct evaluation.
core.optimization module
Module containing the optimization surrogate.
core.optimization.ref_points
     Reference points for benchmark problems.
          Type dict
class core.optimization.Optimization(model)
     Bases: object
     The class to define the optimization problem.
     model
          The model object.
               Type core.Model
     iterations
          Number of optimization iterations.
               Type int
     converged
          Convergence status.
               Type bool
     algorithm
          Optization algorithm object.
     termination
          Termination object.
     n_const
          NUmber of constraints.
               Type int
     ref_point
          Reference point for hypervolume calculation.
               Type np.array
     direct
          Whether a direct optimization is performed.
               Type bool
2                                                          Chapter 1. app
                                                                        Surrogate optimizer, Release 0.0.0
     range_in
          Input parameter allowable ranges.
               Type np.array
     function
          Function used to evaluate the candidates.
     problem
          Problem object.
               Type datamod.problems.Custom
     surrogate
          Surrogate object.
               Type core.Surrogate
     res
          Results object.
               Type pymoo.model.result.Result
     optimization_stats
          Optimization benchmark statistics.
               Type dict
     optimum_model
          Candidates evaluated by the original model.
               Type np.array
     optimum_surrogate
          Candidates evaluated by the surrogate.
               Type np.array
     error_measure
          Maximum of the error metrics.
               Type float
     error
          Benchmark percent error.
               Type np.array
     benchmark()
          Determine the benchmark optimization accuracy.
     optimize()
          Wrapper function to perform optimization.
     plot_results()
          Plot the optimized candidates.
     report()
          Report the optimal solutions and their verification accuracy.
     set_problem(surrogate)
          Wrapper function to set the problem.
               Parameters surrogate (core.Surrogate) – Surrogate object.
1.1. core package                                                                                        3
Surrogate optimizer, Release 0.0.0
            Notes
            Direct optimization does not normalize.
      verify()
            Wrapper function to verify the optimized solutions.
core.settings module
This module provides auxiliary functions to handle settings and files writing and loading.
core.settings.settings
      A shared dictionary of settings accross the framework.
            Type dict
core.settings.ask_to_overwrite(path, id_current, text)
            Parameters
                   • path (str) – Path to the already defined results folder.
                   • id_current (int) – ID of the problem to be solved.
                   • text (str) – Reason for everwriting.
core.settings.check_valid_settings()
      Check if valid settings are used.
core.settings.dump_json(file, data)
      Writes a JSON file.
            Parameters
                   • file (str) – Path and name of the file to be written.
                   • data (dict) – The data to be saved.
core.settings.dump_object(name, *args)
      Pickle dumps the given objects.
            Parameters
                   • name (str) – Path and name of the target file.
                   • args (any) – Any object to be pickle dumped.
core.settings.get_input_from_id(problem_id, problem_folder)
      Get filename from problem ID.
            Parameters
                   • problem_id (int) – ID of the problem to be solved.
                   • problem_folder (str) – Directory which contains the input files.
            Returns Path to the input file of the requested ID.
            Return type file (str)
core.settings.get_results_folders()
      Retrieves all current results folders.
            Returns Path to the directory with result folders. all_result_folder (list): List of all results folders.
            Return type data_folder (str)
4                                                                                                       Chapter 1. app
                                                                               Surrogate optimizer, Release 0.0.0
core.settings.load_json(file)
      Read a JSON file.
            Parameters file (str) – Path and name of the file to be loaded.
            Returns The loaded data.
            Return type data (dict)
core.settings.load_object(name)
      Loads the pickled object.
            Parameters name (str) – Path and name of the file to load.
            Returns The loaded object.
            Return type obj (any)
core.settings.make_workfolder(file, fresh)
      Initialize the workdirectory.
            Parameters
                    • file (str) – Path and name of the current input file.
                    • fresh (bool) – Whether this is a new problem to be solved.
            Returns Path to the current results data folder.
            Return type folder_path (str)
core.settings.restart_check(id_current, file)
            Parameters
                    • id_current (int) – ID of the problem to be solved.
                    • file (str) – Path and name of the current input file.
      Notes
      For load_surrogate, only checking that the problem name is the same.
core.settings.update_settings(problem_id)
      Updates the shared settings dictionary with the settings specified in the input file.
            Parameters problem_id (int) – ID of the problem to be solved.
core.surrogate module
This module handles the surrogate’s training.
core.surrogate.max_samples
      maximum number of training samples above which the training is stopped as unsuccessful
            Type int
class core.surrogate.Surrogate(model)
      Bases: object
      The class to define the surrogate.
      model
            The model object.
1.1. core package                                                                                               5
Surrogate optimizer, Release 0.0.0
              Type core.Model
     name
         Name of the surrogate.
              Type str
     trained
         Whether the surrogate is trained.
              Type bool
     diverging
         Whether the amount of training samples has exceeded the maximal allowable.
              Type bool
     hp_optimized
         Whether the hyperparameters of the surrogate have been optimized.
              Type bool
     optimized_to_samples
         Amount of training samples during last hyperparameter optimization.
              Type int
     reoptimization_ratio
         Sample increase ratio for reoptimization.
              Type float
     no_samples
         Current number of training samples.
              Type int
     sampling_iterations
         Number of training iterations.
              Type int
     convergence_metric
         Dictionary of convergence metrics.
              Type dict
     file
         Path to the training database.
              Type str
     verification_file
         Path to the verification database.
              Type str
     verification
         Verfication samples.
              Type datamod.get_data
     data
         Training samples.
              Type datamod.get_data
6                                                                                   Chapter 1. app
                                                                        Surrogate optimizer, Release 0.0.0
     range_norm
          Range of validity in normalized coordinates.
               Type np.array
     surrogates
          List of cross validation surrogates.
               Type list
     surrogate
          Surrogate trained on all available data.
               Type object
     samples
          New input samples in the current iteration.
               Type np.array
     best_hp
          Optimal hyperparameters.
               Type kerastuner.engine.hyperparameters.HyperParameters
     accuracy
          Benchmark accuracy statistics.
               Type dict
     append_verification()
          Add verification results to database.
     check_convergence()
          Check the convergence of the surrogate’s training.
     evaluate_samples(verify=False)
          Wrapper function to call the evaluted problem solver.
               Parameters verify (bool) – whether this is a verification run
     load_results(verify=False)
          Wrapper function to load the results from the results file
               Parameters verify (bool) – whether this is a verification run
     optimize_hyperparameters()
          Wrapper function to optimize the surrogate’s hyperparameters.
     plot_response(inputs, output, density=30, constants=None, iteration=None)
          Plot the model’s response based on the surrogate.
               Parameters
                    • inputs (list) – Input dimensions to plot.
                    • output (int) – Output dimension to plot.
                    • density (int) – Sampling density of the reponse plot.
                    • constants (list) – Values of the fixed input dimensions.
                    • iteration (int) – Iteration number.
     reload()
          Reloads the surrogate.
1.1. core package                                                                                        7
Surrogate optimizer, Release 0.0.0
     report()
           Plot the convergence metric and report on the trained surrogate.
     sample()
           Wrapper function to obtain the new sample points.
           Notes
           Be careful with geometric, grows fast. If non-adaptive sampling is used, adaptive must be set to None.
     save()
           Saves the surrogate.
     train()
           Wrapper function to (re)train the surrogate.
1.1.2 Module contents
1.2 datamod package
1.2.1 Submodules
datamod.evaluator module
Contains the classes to evaluate the new samples, typically using an external software.
class datamod.evaluator.Evaluator
     Bases: object
     General evaluator class.
     save_results
           Function to write the results into the results database.
     iteration
           Iteration number.
                Type int
     generate_results(samples, file, iteration, verify)
           Generate the response and save the result to the database.
                Parameters
                     • samples (np.array) – Samples to evaluate.
                     • file (str) – Path and name of the database file.
                     • iteration (int) – Iteration number.
                     • verify (bool) – Whether this is a verification evaluation.
class datamod.evaluator.EvaluatorANSYS
     Bases: datamod.evaluator.Evaluator
     Evaluate the samples using ANSYS.
     ansys_project_folder
           Path to the folder of the ANSYS project.
8                                                                                                 Chapter 1. app
                                                                           Surrogate optimizer, Release 0.0.0
              Type str
     input_param_name
         Names of the input parameters.
              Type list
     setup
         ANSYS settings.
              Type dict
     valid_licences
         Licences required for running ANSYS:
              Type list
     can_run_ansys(minimal_amount=2)
         Determine whether there is a sufficient amount of available licenses to run the simulation.
              Parameters minimal_amount (int) – Minimal required amount of available licenses.
              Returns Whether it is possible to run ANSYS or not.
              Return type status (bool)
         Notes
         Returns True whenever at least one license is available.
     check_licenses()
         Request the license server for infomation about license usage.
              Returns Licence names with the number of unused licenses.
              Return type license_status (dict)
     evaluate(samples, verify)
         Evaluate the samples.
              Parameters
                   • samples (np.array) – Samples to evaluate.
                   • verify (bool) – Whether this is a verification evaluation.
              Returns Output values at the samples.
              Return type results (np.array)
     get_info()
         Get information about the problem.
              Returns Input parameter allowable ranges. dim_in (int): Number of input dimensions. dim_out
                  (int): Number of output dimensions. n_constr (int): Number of constraints.
              Return type range_in (np.array)
     scrape_license_info(line)
         Extract the number of available ANSYS licenses.
              Parameters line (str) – Line containing the license usage information.
              Returns Name of the license. available (int): Number of available unused licenses.
              Return type license_name (str)
1.2. datamod package                                                                                        9
Surrogate optimizer, Release 0.0.0
class datamod.evaluator.EvaluatorANSYSAPDL
     Bases: datamod.evaluator.EvaluatorANSYS
     Evaluate the samples through ANSYS APDL.
     Notes
     Not documented thorougly as it is a dev version for the particular problem.
     call_ansys()
          Evaluate the requested input files.
     evaluate(samples, verify)
          Evaluate the samples.
               Parameters
                    • samples (np.array) – Samples to evaluate.
                    • verify (bool) – Whether this is a verification evaluation.
               Returns Output values at the samples.
               Return type response (np.array)
     get_results(verify)
          Retrieve the results from text files.
               Parameters verify (bool) – Whether this is a verification evaluation.
               Returns Output values at the samples.
               Return type response (np.array)
     update_input(samples)
          Update the unput files.
               Parameters samples (np.array) – Input samples to evaluate.
class datamod.evaluator.EvaluatorANSYSWB
     Bases: datamod.evaluator.EvaluatorANSYS
     Evaluate the samples through ANSYS Workbench.
     workbench_project
          Path and name to the ANSYS workbench project.
               Type str
     template
          Path and name to the journal file template.
               Type str
     output
          Path and name to the newly created journal folder.
               Type str
     iteration
          Iteration number.
               Type int
     call_ansys()
          Evaluate the requested input files.
10                                                                                   Chapter 1. app
                                                                         Surrogate optimizer, Release 0.0.0
     evaluate(samples, verify)
          Evaluate the samples.
               Parameters
                    • samples (np.array) – Samples to evaluate.
                    • verify (bool) – Whether this is a verification evaluation.
               Returns Output values at the samples.
               Return type results (np.array)
          Notes
          A trick with iterations
     get_results(verify)
          Retrieve the results from CSV files.
               Parameters verify (bool) – Whether this is a verification evaluation.
               Returns Output values at the samples.
               Return type response (np.array)
     update_input(samples)
          Create an input journal from the template.
               Parameters samples (np.array) – Samples to evaluate.
class datamod.evaluator.EvaluatorBenchmark
     Bases: datamod.evaluator.Evaluator
     Evaluate a benchmark problem on the given sample.
     problem
          Benchmark problem.
     results
          List of values requested from the problem.
               Type list
     evaluate(samples, verify)
          Evaluate the samples.
               Parameters
                    • samples (np.array) – Samples to evaluate.
                    • verify (bool) – Whether this is a verification evaluation.
               Returns Output values at the samples.
               Return type response (np.array)
            Warning: Return_values_of in problem.evaluate doesn’t work - Pymoo implementation problem.
     get_info()
          Get information about the benchmark problem.
1.2. datamod package                                                                                    11
Surrogate optimizer, Release 0.0.0
                Returns Input parameter allowable ranges. dim_in (int): Number of input dimensions. dim_out
                    (int): Number of output dimensions. n_constr (int): Number of constraints.
                Return type range_in (np.array)
           Notes
           return_values_of is wrongly implemented in pymoo
class datamod.evaluator.EvaluatorData
     Bases: datamod.evaluator.Evaluator
     Obtain the response from a data file.
     source_file
           Path and name of the data file.
                Type str
     evaluate(samples, verify)
           Evaluate the samples.
                Parameters
                    • samples (np.array) – Samples to evaluate.
                    • verify (bool) – Whether this is a verification evaluation.
                Returns Output values at the samples.
                Return type response (np.array)
     get_info()
           Load information about a data-defined problem.
                Returns Input parameter allowable ranges. dim_in (int): Number of input dimensions. dim_out
                    (int): Number of output dimensions. n_constr (int): Number of constraints.
                Return type range_in (np.array)
     get_samples(no_samples, no_new_samples)
           Get the coordinates of the new samples.
                Returns Coordinates of the new samples.
                Return type samples(np.array)
class datamod.evaluator.RealoadNotAnEvaluator
     Bases: datamod.evaluator.Evaluator
     Just a programming convenience when reloading a surrogate, doesnt evaluate anything in fact.
     get_info()
           Get information about the problem.
                Returns Input parameter allowable ranges. dim_in (int): Number of input dimensions. dim_out
                    (int): Number of output dimensions. n_constr (int): Number of constraints.
                Return type range_in (np.array)
12                                                                                             Chapter 1. app
                                                                           Surrogate optimizer, Release 0.0.0
datamod.problems module
Function definitions.
This module contains function definitions.
datamod.problems.problems
      Classes of the custom defined problems.
            Type dict
class datamod.problems.CubicSquared
      Bases: pymoo.model.problem.Problem
      Squared function.
class datamod.problems.Custom(function, xl, xu, n_obj, n_constr)
      Bases: pymoo.model.problem.Problem
      Class for custom built problems using a surrogate.
      function
            The response function.
class datamod.problems.GettingStarted
      Bases: pymoo.model.problem.Problem
      Pymoo example problem.
      References
      http://pymoo.org/getting_started.html
class datamod.problems.MatlabPeaks
      Bases: pymoo.model.problem.Problem
      MATLAB peaks function definition.
      References
      https://www.mathworks.com/help/matlab/ref/peaks.html
class datamod.problems.Squared
      Bases: pymoo.model.problem.Problem
      Squared function.
datamod.results module
This module contains functions to handle the results database.
datamod.results.append_verification_to_database(file, verification_file)
      Appends the results from the verification to the training database.
            Parameters
                   • file (str) – Path and name of the training database file.
                   • verification_file (str) – Path and name of the verification database file.
1.2. datamod package                                                                                      13
Surrogate optimizer, Release 0.0.0
datamod.results.header_names(dim_in, n_obj, n_const)
     Determines the header names.
           Parameters
                   • dim_in (int) – Number of input dimensions.
                   • n_const (int) – Number of constraints.
                   • n_obj (int) – Number of objectives.
           Returns Header names.
           Return type headers (list)
datamod.results.load_results(file)
     Loads the data from the result database.
           Parameters file (str) – Path and name of the database file.
           Returns Number of input dimensions. col_names (np.array): Name if stored variables. data
                 (np.array): Samples.
           Return type dim_in (int)
datamod.results.make_data_file(file, dim_in, n_obj, n_constr)
     Initialize the results file header.
           Parameters
                   • file (str) – Path and name of the database file.
                   • dim_in (int) – Number of input dimensions.
                   • n_const (int) – Number of constraints.
                   • n_obj (int) – Number of objectives.
datamod.results.make_response_files(folder, dim_in, n_obj, n_constr)
     Sets up the training and verification database files.
           Parameters
                   • folder (str) – Path to the current results data folder.
                   • dim_in (int) – Number of input dimensions.
                   • n_const (int) – Number of constraints.
                   • n_obj (int) – Number of objectives.
           Returns List of the database files paths.
           Return type files (list)
datamod.results.write_results(file, inputs, outputs)
     Write the samples to the database.
           Parameters
                   • inputs (np.array) – Input coordinates.
                   • outputs (np.array) – Output coordinates.
14                                                                                     Chapter 1. app
                                                                           Surrogate optimizer, Release 0.0.0
datamod.sampling module
This is the sampling module.
This module provides sampling methods.
datamod.sampling.adaptive_methods
      Exploration and exploitation criteria for adaptive sampling methods.
             Type dict
datamod.sampling.sample_bounds
      Sampling range.
             Type tuple
datamod.sampling.samplings
      Defined sampling classes.
             Type dict
class datamod.sampling.Halton(**kwargs)
      Bases: smt.sampling_methods.sampling_method.SamplingMethod
      Halton sampling.
      References
      https://gist.github.com/tupui/cea0a91cc127ea3890ac0f002f887bae
datamod.sampling.determine_samples(no_samples, dim_in)
      Determine the number of new samples.
             Parameters
                    • dim_in (int) – Number of input dimensions.
                    • no_samples (int) – number of current samples.
             Returns Number of new samples.
             Return type new_samples (int)
datamod.sampling.resample_adaptive(points_new, surrogates, data, range_in, iteration)
      Determine the coordinates of the new samples using an adaptive DoE.
             Parameters
                    • points_new (int) – Number of new samples.
                    • range_in (np.array) – Range of input variables.
                    • surrogates (list) – Surrogates from cross-validation.
                    • data (datamod.get_data) – Training samples.
                    • range_in – Range of input variables.
                    • iteration (int) – Iteration number.
             Returns Coordinates of the new samples.
             Return type coordinates (np.array)
datamod.sampling.resample_static(points_new, points_now, range_in)
      Determine the coordinates of the new samples using a static DoE.
1.2. datamod package                                                                                      15
Surrogate optimizer, Release 0.0.0
          Parameters
                 • points_new (int) – Number of new samples.
                 • points_now (int) – number of current samples.
                 • range_in (np.array) – Range of input variables.
          Returns Coordinates of the new samples.
          Return type coordinates (np.array)
datamod.sampling.response_grid(density, inputs, ranges)
     Returns a grid of samples with the desired ranges.
          Parameters
                 • density (int) – Density of the samples plot.
                 • inputs (list) – Input dimensions to plot.
                 • ranges (np.array) – Range of input variables.
          Returns Grid samples.
          Return type sample_desired (np.array)
datamod.sampling.sample(name, points, n_dim)
     Sampling on a unit hypercube - typically [-1,1], using a selected DoE.
          Parameters
                 • name (str) – Sampling strategy.
                 • points (int) – Number of requested samples.
                 • n_dim (int) – Number of input dimensions.
          Returns New samples.
          Return type samples (np.array)
          Raises NameError – if the sampling is not defined.
     Notes
     Grid actually doesn’t make full grid.
datamod.sampling.sample_adaptive(data, samples, predictions, no_points_new, iteration)
     Sampling using an adaptive DoE.
          Parameters
                 • data (datamod.get_data) – Training samples.
                 • samples (np.array) – Proposed samples.
                 • predictions (np.array) – Predictions of the surrogates from cross-validation.
                 • no_points_new (int) – Number of new samples.
                 • iteration (int) – Iteration number.
          Returns Normalized coordinates of the new samples.
          Return type candidates (np.array)
16                                                                                        Chapter 1. app
                                                                     Surrogate optimizer, Release 0.0.0
datamod.sampling.scale_samples(range_in, samples)
      Scales the samples to the desired range.
           Parameters
                   • range_in (np.array) – Range of input variables.
                   • samples (np.array) – Samples to be scaled.
           Returns Coordinates of the new samples.
           Return type coordinates (np.array)
1.2.2 Module contents
Data handling module.
The aim of the datamod package is to handle the data.
class datamod.get_data(file)
      Bases: object
      Import data from an external file.
      dim_in
           Number of input dimensions.
                Type int
      col_names
           Names of columns.
                Type list
      dim_out
           Number of output dimensions.
                Type int
      coordinates
           Samples coordinates.
                Type np.array
      response
           Sample response.
                Type np.array
      input
           Normalized input samples.
                Type np.array
      output
           Normalized output samples.
                Type np.array
      norm_in
           Input normalization factors.
                Type np.array
      norm_out
           Output normalization factors.
1.2. datamod package                                                                                17
Surrogate optimizer, Release 0.0.0
                Type np.array
      range_in
           Range of the input data.
                Type np.array
      range_out
           Range of the output data.
                Type np.array
datamod.get_range(data)
      Determine the range of the data.
           Parameters data (np.array) – Data to analyze.
           Returns Ranges of the given data.
           Return type ranges (np.array)
datamod.load_problem(name)
      Load a pre-defined benchmark problem.
           Parameters name (str) – Name of the desired problem.
           Returns Benchmark problem. range_in (np.array): Input parameter allowable ranges. dim_in (int):
                Number of input dimensions. dim_out (int): Number of output dimensions. n_constr (int):
                Number of constraints.
           Return type problem ()
datamod.normalize(data)
      Normalize the data to the [-1,1] range.
           Parameters data (np.array) – Data to normalize.
datamod.scale(data, ranges)
      Scale data from [-1,1] range to original range.
           Parameters
                   • data (np.array) – Data to scale.
                   • ranges (np.array) – Normalization ranges.
      Returns (np.array): data_scale: Scaled data.
1.3 metamod package
1.3.1 Submodules
metamod.ANN module
Custom ANN definition.
This module contains the definition of an ANN comptable with the SMT Toolbox.
class metamod.ANN.ANN_base(**kwargs)
      Bases: smt.surrogate_models.surrogate_model.SurrogateModel
      ANN general class.
18                                                                                           Chapter 1. app
                                                                                Surrogate optimizer, Release 0.0.0
      tbd
           Settings to be declared.
                Type dict_keys
      log_dir
           Directory to store the ANN model.
                Type str
      validation_points
           Validation points.
                Type dict
      optimized
           Whether the hyperparameters have been optimized.
                Type bool
      set_validation_values(xt, yt, name=None)
           Set validation data (values).
                Parameters
                     • xt (np.ndarray[nt, nx] or np.ndarray[nt]) – The input values for the nt
                       training points.
                     • yt (np.ndarray[nt, ny] or np.ndarray[nt]) – The output values for the nt
                       training points.
                     • name (str or None) – An optional label for the group of training points being set.
                       This is only used in special situations (e.g., multi-fidelity applications).
      write_stats(dictionary_as_list, name)
           Writes the statistics about the surrogate’s training.
                Parameters
                     • dictionary_as_list (list) – Training statistics.
                     • name (str) – Name of the file to be written.
metamod.ANN_pt module
Custom ANN definition using TensorFlow.
This module contains the definition of an ANN comptable with the SMT Toolbox.
metamod.ANN_pt.activations
      Available activation functions.
           Type dict
metamod.ANN_pt.initializers
      Available kernel initializers.
           Type dict
1.3. metamod package                                                                                           19
Surrogate optimizer, Release 0.0.0
Notes
Keras tuner logs are not stored in data due to max path length issues in kerastuner.
See also:
PyTorch documentation - https://pytorch.org/docs/stable/index.html
class metamod.ANN_pt.ANN_pt(**kwargs)
      Bases: metamod.ANN.ANN_base
      ANN class.
      name
           Name of the surrogate model.
                Type str
      model
           The model of the ANN.
      early_stop
           Number of training epchs before early stopping.
                Type int
      build_hypermodel(hp)
           Build the hypermodel of the ANN with Keras Tuner hyperparameters.
                Parameters hp (kerastuner.engine.hyperparameters.HyperParameters) –
                     Hyperparameters.
                Returns The model of the ANN.
                Return type model ()
           Notes
           No kernel regularizers implemented so far.
           See also:
           Keras Tuner documentation: https://keras-team.github.io/keras-tuner/
      pretrain(inputs, outputs, iteration)
           Optimize the hyperparameters of the ANN.
                Parameters
                     • inputs (np.array) – All input data.
                     • outputs (np.array) – All output data.
                     • iteration (int) – Iteration number.
                Returns Optimal hyperparameters.
                Return type best_hp (kerastuner.engine.hyperparameters.HyperParameters)
           Notes
           Optimization objective fixed on val_loss.
20                                                                                      Chapter 1. app
                                                                           Surrogate optimizer, Release 0.0.0
     save()
          Save the ANN into an external file.
class metamod.ANN_pt.SparseModel(neurons_hyp, activation_hyp, kernel_regularizer, in_dim, lay-
                                               ers_hyp, out_dim, init, bias_init)
     Bases: torch.nn.modules.module.Module
     Defines an ANN with a subnetwork for each output.
     activation
          Activation function.
               Type function
     subnetworks
          Neural network.
     early_stopping(history, metric, tolerance, patience)
          Check whether the early stopping condition has been met.
               Parameters
                    • history (metamod.ANN_pt.TrainHistory) – Metrics history during the train-
                      ing.
                    • metric (str) – Early stopping decision metric.
                    • tolerance (float) – Early stopping tolerance.
                    • patience (int) – Early stopping patience.
               Returns Whether to early stop the training.
               Return type stop (bool)
     fit(epochs, train_in, train_out, test_in=None, test_out=None, optimizing=False)
          Train the ANN.
               Parameters
                    • epochs (int) –
                    • train_in (torch.Tensor) – Train input data.
                    • train_out (torch.Tensor) – Train output data.
                    • test_in (torch.Tensor) – Test input data.
                    • test_out (torch.Tensor) – Test output data.
                    • optimizing (bool) – Whether this is an optimization run.
               Returns Metrics history during the training.
               Return type history (metamod.ANN_pt.TrainHistory)
     forward(x)
          Forward-pass throught the network.
               Parameters x (torch.Tensor) – Input tensor.
               Returns Output tensor.
               Return type out (torch.Tensor)
class metamod.ANN_pt.TrainHistory
     Bases: object
     This class stored the metrics history.
1.3. metamod package                                                                                      21
Surrogate optimizer, Release 0.0.0
      history
           Stores training and validation losses.
                Type dict
      store(loss, loss_eval=None)
metamod.ANN_pt.swish(x)
      Swish activation function.
           Parameters x (torch.Tensor) – Weighted inputs.
           Returns Neuron’s activations.
           Return type activation (torch.Tensor)
metamod.ANN_tf module
Custom ANN definition using TensorFlow.
This module contains the definition of an ANN comptable with the SMT Toolbox
Notes
Keras tuner logs are not stored in data due to max path length issues in kerastuner.
See also:
Tensorflow Keras documentation - https://www.tensorflow.org/api_docs/python/tf/keras
class metamod.ANN_tf.ANN(**kwargs)
      Bases: metamod.ANN.ANN_base
      ANN class.
      name
           Name of the surrogate model.
                Type str
      model
           The model of the ANN.
      early_stop
           Number of training epchs before early stopping.
                Type int
      build_dense_model(neurons_hyp,              activation_hyp,    kernel_regularizer, in_dim,  layers_hyp,
                                  out_dim)
           Defines an fully connected ANN.
                Parameters
                     • neurons_hyp (int) – Number of neurons per layer.
                     • activation_hyp (str) – Activation function name.
                     • () (kernel_regularizer) –
                     • in_dim (int) – Number of input dimensions.
                     • layers_hyp (int) – Number of hidden layers.
                     • out_dim (int) – Number of output dimensions.
22                                                                                               Chapter 1. app
                                                                          Surrogate optimizer, Release 0.0.0
              Returns The model of the ANN.
              Return type model ()
     build_hypermodel(hp)
         General claass to build the ANN using TensorFlow with Keras Tuner hyperparameters defined.
              Parameters hp (kerastuner.engine.hyperparameters.HyperParameters) –
                  Hyperparameters.
              Returns The model of the ANN.
              Return type model ()
         Notes
         Hyperparameters initialized using default values in config file.
     build_sparse_model(neurons_hyp, activation_hyp, kernel_regularizer, in_dim, layers_hyp,
                                out_dim)
         Defines an ANN with a subnetwork for each output.
              Parameters
                  • neurons_hyp (int) – Number of neurons per layer.
                  • activation_hyp (str) – Activation function name.
                  • () (kernel_regularizer) –
                  • in_dim (int) – Number of input dimensions.
                  • layers_hyp (int) – Number of hidden layers.
                  • out_dim (int) – Number of output dimensions.
              Returns The model of the ANN.
              Return type model ()
     get_callbacks()
         Set-up the requiested callbacks to be entered into the model.
              Returns A list of callbacks.
              Return type callbacks (list)
         Notes
         MyStopping is never used.
     pretrain(inputs, outputs, iteration)
         Optimize the hyperparameters of the ANN.
              Parameters
                  • inputs (np.array) – All input data.
                  • outputs (np.array) – All output data.
                  • iteration (int) – Iteration number.
              Returns Optimal hyperparameters.
              Return type best_hp (kerastuner.engine.hyperparameters.HyperParameters)
1.3. metamod package                                                                                     23
Surrogate optimizer, Release 0.0.0
           Notes
           Optimization objective fixed on val_loss.
     prune_model(model, target_sparsity)
           Extends the ANN’s model with priuning layers.
                Parameters
                     • () (model) – The model of the ANN.
                     • target_sparsity (float) – Target constant sparsity of the network.
                Returns The model of the ANN.
                Return type model ()
           Notes
           Only constant sparsity active.
     save()
           Save the ANN into an external file.
metamod.deploy module
Module to assist the deployment of the surrogate.
metamod.deploy.get_input_coordinates(density, requested_dims, range_norm)
     Obtain the grid samples.
           Parameters
                   • density (int) – Sampling density of the reponse plot.
                   • requested_dims (list) – Input dimensions to plot.
                   • range_norm (np.array) – Range of validity in normalized coordinates.
           Returns Grid samples.
           Return type samples (np.array)
metamod.deploy.get_plotting_coordinates(density, requested_dims, dim_in, normaliza-
                                                         tion_factors, range_norm, constants)
     Obtain the grid samples for plotting.
           Parameters
                   • density (int) – Sampling density of the reponse plot.
                   • requested_dims (list) – Input dimensions to plot.
                   • dim_in (int) – Number of input dimensions.
                   • normalization_factors (np.array) – Input normalization factors.
                   • range_norm (np.array) – Range of validity in normalized coordinates.
                   • constants (list) – Values of the fixed input dimensions.
           Returns Grid samples.
           Return type samples (np.array)
24                                                                                            Chapter 1. app
                                                                             Surrogate optimizer, Release 0.0.0
metamod.performance module
Module to access the performance of the surrogate.
metamod.performance.defined_metrics
     Available metrics.
           Type dict
metamod.performance.RMSE(*args, **kwargs)
     Returns the root mean squared error.
metamod.performance.benchmark_accuracy(surrogate)
           Parameters surrogate (core.Surrogate) – Trained surrogate.
           Returns Benchmark accuracy statistics.
           Return type diffs (dict)
metamod.performance.check_convergence(metrics)
     Checks whether the metric meets the convergence criterion.
           Parameters metrics (list) – List of the convergence metrics for each iteration.
           Returns Convergence status.
           Return type trained (bool)
     Notes
     Need to add convergence if data is loaded and there is no more data to load
metamod.performance.convergence_operator()
     Obtain either greater than or lower than operator based on the convergence metric type.
           Returns Direction logical operator.
           Return type op (function)
metamod.performance.evaluate_metrics(inputs, outputs, predict)
     Evaluates surrogate accuracy metrics based on test samples.
           Parameters
                  • inputs (np.array) – Test samples.
                  • outputs (np.array) – Test response.
                  • predict (SurrogateModel.predict_values) – Surrogate’s prediction method.
           Returns Surrogate accuracy metrics.
           Return type metrics (dict)
metamod.performance.report_divergence()
     Report the problem ID if the surrogate training fails to converge with the maximal amount of training samples.
metamod.performance.retrieve_metric(surrogates)
     Calculates the mean and variance of the assessed metric.
           Parameters surrogates (list) – List of cross validation surrogates.
           Returns Mean and variance of the assessed metric.
           Return type output_metrics (dict)
1.3. metamod package                                                                                            25
Surrogate optimizer, Release 0.0.0
metamod.validation module
This module provides cross-validation splitting techniques.
metamod.validation.split_methods
      CV validation techniques.
           Type dict
metamod.validation.invalid_param()
      Raise error if validation parameter is invalid.
           Raises NameError – if validation parameter is invalid.
metamod.validation.set_validation(validation, param)
      Select the desired validation technique model.
           Parameters
                   • validation (str) – Validation technique name.
                   • param (float/int) – Validation technique parameter.
           Returns Indices for the split.
           Return type split (np.array)
metamod.validation.split_holdout(param)
      Select the desired validation technique model.
           Parameters param (float) – Holdout ratio.
           Returns Indices for the split.
           Return type split (np.array)
metamod.validation.split_kfold(param)
      Select the desired validation technique model.
           Parameters param (int) – Number of splits.
           Returns Indices for the split.
           Return type split (np.array)
metamod.validation.split_rlt(param)
      Select the desired validation technique model.
           Parameters param (float) – Holdout ratio.
           Returns Indices for the split.
           Return type split (np.array)
1.3.2 Module contents
Surrogate package.
The aim of the metamod package is to produce and run a surrogate model.
metamod.cross_validate(data, iteration, best_hp)
      Train the defined surrogate on the provided data.
           Parameters
                   • data (datamod.get_data) – Training samples.
26                                                                       Chapter 1. app
                                                                          Surrogate optimizer, Release 0.0.0
                  • iteration (int) – Iteration number.
                  • best_hp (kerastuner.engine.hyperparameters.HyperParameters) –
                     Optimal hyperparameters.
          Returns List of cross validation surrogates.
          Return type surrogates (list)
metamod.optimize_hyperparameters(data, iteration)
     Train the defined surrogate on the provided data.
          Parameters
                  • data (datamod.get_data) – Training samples.
                  • iteration (int) – Iteration number.
          Returns Optimal hyperparameters.
          Return type best_hp (kerastuner.engine.hyperparameters.HyperParameters)
metamod.reload_info()
     Get information about the problem.
          Returns Input parameter allowable ranges. dim_in (int): Number of input dimensions. dim_out
                (int): Number of output dimensions. n_constr (int): Number of constraints.
          Return type range_in (np.array)
metamod.set_surrogate(name, dim_in, dim_out)
     Select the desired surrogate model.
          Parameters
                  • name (str) – Name of the surrogate.
                  • dim_in (int) – Number of input dimensions.
                  • dim_out (int) – Number of output dimensions.
          Returns Initialized surrogate model.
          Return type surrogate (object)
          Raises NameError – If the surrogate is not defined-
metamod.train_surrogate(data, best_hp)
          Parameters
                  • data (datamod.get_data) – Training samples.
                  • best_hp (kerastuner.engine.hyperparameters.HyperParameters) –
                     Optimal hyperparameters.
          Returns Surroggate trained on all training samples.
          Return type model (object)
1.4 optimod package
1.4.1 Submodules
1.4. optimod package                                                                                     27
Surrogate optimizer, Release 0.0.0
optimod.performance module
Module to access the performance of the optimization.
optimod.performance.calculate_hypervolume(data, ref_point)
      Text.
            Parameters
                  • data (np.array) – Pareto front.
                  • ref_point (np.array) – Reference point.
            Returns Hypervolume size.
            Return type hv (float)
optimod.performance.verify_results(results, surrogate)
      Text.
            Parameters
                  • results (np.array) – Pareto set results.
                  • surrogate (core.Surrogate) – Surrogate object.
            Returns Set of verification indices.
            Return type idx (np.array)
optimod.termination module
Module to provide the termination object.
optimod.termination.default_termination(n_obj, params)
      Text.
            Parameters
                  • n_obj (int) – Number of objectives.
                  • params (list) – Termination parameters.
            Returns Termination object.
            Return type termination ()
1.4.2 Module contents
Optimization package.
The aim of the optimod package is to perform optimization.
optimod.get_operator(name, setup)
      Text.
            Parameters
                  • name (str) – Operator name to retrieve.
                  • setup (dict) – Optimization setup parameters.
            Returns Retrieved operator.
            Return type operator ()
28                                                                 Chapter 1. app
                                                                          Surrogate optimizer, Release 0.0.0
optimod.set_algorithm(name, no_obj, setup)
     Text.
           Parameters
                  • name (str) – Name of the optimization algorithm.
                  • n_obj (int) – Number of objectives.
                  • setup (dict) – Optimization setup parameters.
           Returns Optization algorithm object.
           Return type algorithm ()
optimod.set_optimization(no_obj)
     Set the selected optimization technique.
           Parameters n_obj (int) – Number of objectives.
           Returns Optization algorithm object. termination (): Termination object.
           Return type algorithm ()
optimod.solve_problem(problem, algorithm, termination, direct)
     Solve the defined problem.
           Parameters
                  • problem (datamod.problems.Custom) – Problem to solve.
                  • () (termination) – Optimization algorithm.
                  • () – Termination method.
                  • direct (bool) – Whether this is a direct optimization run.
           Returns Results object.
           Return type res (pymoo.model.result.Result)
     Notes
     Save_history will work with ANN surrogate from Tensorflow only if line 290                     in  site-
     packagespymoomodellgorithm is changed from deepcopy to copy. Optional seed not implemented.
optimod.unnormalize_res(res, norm_in, norm_out)
     Unnormliazes results.
           Parameters
                  • res (pymoo.model.result.Result) – Results object (unnormalized).
                  • norm_in (np.array) – Input normalization factors.
                  • norm_out (np.array) – Output normalization factors.
           Returns Results object (normalized).
           Return type res (pymoo.model.result.Result)
     Notes
     Implemented for: F,X.
1.4. optimod package                                                                                      29
Surrogate optimizer, Release 0.0.0
1.5 run module
This is the main module of the framework.
run.problem_ids
      List of problem IDs to solve.
            Type list
run.model
      Model object.
            Type core.Model
run.build_surrogate
      Whether to build a surrogate.
            Type bool
run.load_surrogate
      Whether to load a surrogate.
            Type bool
run.train_from_data
      Whether to train from data.
            Type bool
run.perform_optimization
      Whether to perform optimization.
            Type bool
run.surrogate
      Surrogate object.
            Type core.Surrogate
run.optimization
      Optimization object.
            Type core.Optimization
run.optimize(surrogate)
      Optimization.
            Parameters surrogate (core.Surrogate/None) – The surrogate object
run.reload_surrogate()
      Reloads a saved surrogate model.
run.train_surrogate()
      Training of the surrogate model.
1.6 visumod package
1.6.1 Submodules
30                                                                            Chapter 1. app
                                                                              Surrogate optimizer, Release 0.0.0
visumod.plots module
This module provides the actual plots.
visumod.plots.adaptive_candidates(candidates, data, iteration)
      Plot the adapative sampling candidate points.
            Parameters
                  • candidates (np.array) – Candidate samples.
                  • data (np.array) – Combined adaptive sampling metric.
                  • iteration (int) – Iteration number.
visumod.plots.curve(data, name, labels, units, lower_bound=False)
      A curve plot.
            Parameters
                  • data (np.array) – Data to plot.
                  • name (str) – Filename.
                  • labels (list) – Axis labels.
                  • units (list) – Units of plotted quantities.
                  • lower_bound (bool) – Whether to put a lower plot bound at 0.
visumod.plots.get_blackblue_cmap()
      Get a custom black-blue colormap.
            Returns Defined colormap.
            Return type newmap (matplotlib.colors.LinearSegmentedColormap)
visumod.plots.get_plot_args(data, label)
      Get plot arguments.
            Parameters
                  • data (np.array) – Data to plot.
                  • label (str) – Variable name for label.
            Returns Plot arguments.
            Return type plot_args (dict)
visumod.plots.heatmap(correlation)
      A heatmap plot.
            Parameters correlation (np.array) – Correlation matrix.
visumod.plots.learning_curves(training_loss, validation_loss, data_train,                   prediction_train,
                                             data_test, prediction_test, progress)
      A 2-figure plot of learning curves and plot correlations.
            Parameters
                  • training_loss (list) – Loss history on the training data.
                  • validation_loss (list) – Loss history on the testing data.
                  • () (prediction_test) – Training output data.
                  • () – Training output prediction.
1.6. visumod package                                                                                          31
Surrogate optimizer, Release 0.0.0
                  • () – Testing output data.
                  • () – Testing output prediction.
                  • progress (list) – Training progress status.
visumod.plots.pareto_fronts(pf_true, pf_calc)
     A scatter plot of Pareto fronts comparison.
           Parameters
                  • pf_true (np.array) – True Pareto front.
                  • pf_calc (np.array) – Calculated Pareto front.
visumod.plots.pcp(data, name)
     A parallel component plot.
           Parameters
                  • data (np.array) – Data to plot.
                  • name (str) – Filename.
visumod.plots.save_figure(name, plot=None, iteration=None)
     Save the given figure.
           Parameters
                  • name (str) – Filename.
                  • () (plot) – Pymoo plot obejct.
                  • iteration (int) – Iteration number.
visumod.plots.scatter(data, name, lower_bound=False, compare=False)
     A scatter plot.
           Parameters
                  • data (np.array) – Data to plot.
                  • name (str) – Filename.
                  • lower_bound (bool) – Whether to put a lower plot bound at 0.
                  • compare (bool) – Whetther this is a surrogate comparison plot.
visumod.plots.scatter_pymoo(data, name, label=None, **kwargs)
     Plot either a scatter, curve or surface plot.
           Parameters
                  • data (np.array) – Data to plot.
                  • name (str) – Visualization type.
                  • label (str) – Variable name for label.
     Notes
     Surface plot not used.
visumod.plots.surface_pymoo(data, iteration)
     A surface plot using Pymoo.
           Parameters
32                                                                                 Chapter 1. app
                                                                         Surrogate optimizer, Release 0.0.0
                    • data (np.array) – Data to plot.
                    • iteration (int) – Iteration number.
1.6.2 Module contents
This is the visualization module.
visumod.compare_pareto_fronts(pf_true, pf_calc)
      Compare 2D Pareto fronts.
             Parameters
                    • pf_true (np.array) – True Pareto front.
                    • pf_calc (np.array) – Calculated Pareto front.
visumod.compare_surrogate(inputs, outputs, predict, iteration)
      Plot the comparison of raw data and surrogate response.
             Parameters
                    • inputs (np.array) – Input data.
                    • outputs (np.array) – Output data.
                    • predict (method) – Predict method of the surrogate.
                    • iteration (int) – Iteration number.
visumod.correlation_heatmap(predict, dim_in)
      Plot the correleation heatmap between variables.
             Parameters
                    • predict (method) – Predict method of the surrogate.
                    • dim_in (int) – Number of input dimensions.
visumod.plot_adaptive_candidates(candidates, data, iteration)
      Plot candidates for adaptive sampling.
             Parameters
                    • candidates (np.array) – Candidate samples.
                    • data (np.array) – Combined adaptive sampling metric.
                    • iteration (int) – Iteration number.
visumod.plot_raw(data, iteration, normalized=False)
      Plot either a scatter, curve or surface plot.
             Parameters
                    • data (np.array) – Raw data samples.
                    • iteration (int) – Iteration number.
                    • normalized (bool) – Whether the data is normalized.
1.6. visumod package                                                                                    33
Surrogate optimizer, Release 0.0.0
     Notes
     Surface plot not used yet.
visumod.plot_training_history(history, train_in, train_out, test_in, test_out, predict, progress)
     Plot the evolution of the training and testing error.
           Parameters
                  • history          (tensorflow.python.keras.callbacks.History/metamod.
                    ANN_pt.TrainHistory) – Metrics history during the training.
                  • train_in (np.array/torch.Tensor) – Training input data.
                  • train_out (np.array/torch.Tensor) – Training output data.
                  • test_in (np.array/torch.Tensor) – Testing input data.
                  • test_out (np.array/torch.Tensor) – Testing output data.
                  • predict (method) – Predict method of the surrogate.
                  • progress (list) – Training progress status.
visumod.sample_size_convergence(metrics)
     Plot the sample size convergence.
           Parameters metrics (dict) – Dictionary of convergence metrics.
visumod.surrogate_response(inputs, outputs, iteration)
     Plot the surrogate response.
           Parameters
                  • inputs (np.array) – Input data.
                  • outputs (np.array) – Output to plot.
                  • iteration (int) – Iteration number.
visumod.vis_design_space(data, iteration)
     Visualize the design space in design coordinates.
           Parameters
                  • res (pymoo.model.result.Result) – Results object.
                  • iteration (int) – Iteration number.
visumod.vis_objective_space(data, iteration)
     Visualize the design space in objective coordinates.
           Parameters
                  • res (pymoo.model.result.Result) – Results object.
                  • iteration (int) – Iteration number.
visumod.vis_objective_space_pcp(data, iteration)
     Visualize the design space in objective coordinates with the parallel coordinates plot.
           Parameters
                  • data (np.array) – Multidimensional Pareto front.
                  • iteration (int) – Iteration number.
34                                                                                           Chapter 1. app
                CHAPTER    2
           Indices and tables
• genindex
• modindex
• search
                            35
Surrogate optimizer, Release 0.0.0
36                                 Chapter 2. Indices and tables
                        Python Module Index
c
core, 8
core.model, 1
core.optimization, 2
core.settings, 4
core.surrogate, 5
d
datamod, 17
datamod.evaluator, 8
datamod.problems, 13
datamod.results, 13
datamod.sampling, 15
m
metamod, 26
metamod.ANN, 18
metamod.ANN_pt, 19
metamod.ANN_tf, 22
metamod.deploy, 24
metamod.performance, 25
metamod.validation, 26
o
optimod, 28
optimod.performance, 28
optimod.termination, 28
r
run, 30
v
visumod, 33
visumod.plots, 31
                                         37
Surrogate optimizer, Release 0.0.0
38                                 Python Module Index
                                                                                                     Index
A                                                         C
accuracy (core.surrogate.Surrogate attribute), 7          calculate_hypervolume() (in module opti-
activation (metamod.ANN_pt.SparseModel at-                        mod.performance), 28
         tribute), 21                                     call_ansys()                                  (data-
activations (in module metamod.ANN_pt), 19                        mod.evaluator.EvaluatorANSYSAPDL
adaptive_candidates()             (in    module       vi-         method), 10
         sumod.plots), 31                                 call_ansys()                                  (data-
adaptive_methods (in module datamod.sampling),                    mod.evaluator.EvaluatorANSYSWB method),
         15                                                       10
algorithm (core.optimization.Optimization attribute),     can_run_ansys()                               (data-
         2                                                        mod.evaluator.EvaluatorANSYS       method),
ANN (class in metamod.ANN_tf ), 22                                9
ANN_base (class in metamod.ANN), 18                       check_convergence() (core.surrogate.Surrogate
ANN_pt (class in metamod.ANN_pt), 20                              method), 7
ansys_project_folder                              (data-  check_convergence()          (in   module      meta-
         mod.evaluator.EvaluatorANSYS         attribute),         mod.performance), 25
         8                                                check_licenses()                              (data-
append_verification()                                             mod.evaluator.EvaluatorANSYS       method),
         (core.surrogate.Surrogate method), 7                     9
append_verification_to_database()                     (in check_valid_settings()             (in       module
         module datamod.results), 13                              core.settings), 4
ask_to_overwrite() (in module core.settings), 4           col_names (datamod.get_data attribute), 17
                                                          compare_pareto_fronts() (in module visumod),
B                                                                 33
benchmark()             (core.optimization.Optimization   compare_surrogate() (in module visumod), 33
         method), 3                                       converged (core.optimization.Optimization attribute),
benchmark_accuracy()            (in    module      meta-          2
         mod.performance), 25                             convergence_metric (core.surrogate.Surrogate at-
best_hp (core.surrogate.Surrogate attribute), 7                   tribute), 6
build_dense_model()             (metamod.ANN_tf.ANN       convergence_operator() (in module meta-
         method), 22                                              mod.performance), 25
build_hypermodel() (metamod.ANN_pt.ANN_pt                 coordinates (datamod.get_data attribute), 17
         method), 20                                      core (module), 8
build_hypermodel()              (metamod.ANN_tf.ANN       core.model (module), 1
         method), 23                                      core.optimization (module), 2
build_sparse_model()            (metamod.ANN_tf.ANN       core.settings (module), 4
         method), 23                                      core.surrogate (module), 5
build_surrogate (in module run), 30                       correlation_heatmap() (in module visumod), 33
                                                          cross_validate() (in module metamod), 26
                                                                                                            39
Surrogate optimizer, Release 0.0.0
CubicSquared (class in datamod.problems), 13              EvaluatorBenchmark (class in datamod.evaluator),
curve() (in module visumod.plots), 31                             11
Custom (class in datamod.problems), 13                    EvaluatorData (class in datamod.evaluator), 12
                                                          evaluators (in module core.model), 1
D
data (core.surrogate.Surrogate attribute), 6              F
datamod (module), 17                                      file (core.surrogate.Surrogate attribute), 6
datamod.evaluator (module), 8                             fit() (metamod.ANN_pt.SparseModel method), 21
datamod.problems (module), 13                             forward() (metamod.ANN_pt.SparseModel method),
datamod.results (module), 13                                      21
datamod.sampling (module), 15                             function (core.optimization.Optimization attribute), 3
default_termination() (in module opti-                    function (datamod.problems.Custom attribute), 13
        mod.termination), 28
defined_metrics             (in        module       meta- G
        mod.performance), 25                              generate_results()                               (data-
determine_samples()              (in     module     data-         mod.evaluator.Evaluator method), 8
        mod.sampling), 15                                 get_blackblue_cmap() (in module visumod.plots),
dim_in (core.model.Model attribute), 1                            31
dim_in (datamod.get_data attribute), 17                   get_callbacks() (metamod.ANN_tf.ANN method),
dim_out (core.model.Model attribute), 1                           23
dim_out (datamod.get_data attribute), 17                  get_data (class in datamod), 17
direct (core.optimization.Optimization attribute), 2      get_info()        (datamod.evaluator.EvaluatorANSYS
diverging (core.surrogate.Surrogate attribute), 6                 method), 9
dump_json() (in module core.settings), 4                  get_info() (datamod.evaluator.EvaluatorBenchmark
dump_object() (in module core.settings), 4                        method), 11
                                                          get_info()           (datamod.evaluator.EvaluatorData
E                                                                 method), 12
early_stop (metamod.ANN_pt.ANN_pt attribute), 20          get_info() (datamod.evaluator.RealoadNotAnEvaluator
early_stop (metamod.ANN_tf.ANN attribute), 22                     method), 12
early_stopping() (metamod.ANN_pt.SparseModel              get_input_coordinates() (in module meta-
        method), 21                                               mod.deploy), 24
error (core.optimization.Optimization attribute), 3       get_input_from_id() (in module core.settings), 4
error_measure (core.optimization.Optimization at-         get_operator() (in module optimod), 28
        tribute), 3                                       get_plot_args() (in module visumod.plots), 31
evaluate()          (datamod.evaluator.EvaluatorANSYS     get_plotting_coordinates() (in module meta-
        method), 9                                                mod.deploy), 24
evaluate() (datamod.evaluator.EvaluatorANSYSAPDL          get_range() (in module datamod), 18
        method), 10                                       get_results()                                    (data-
evaluate() (datamod.evaluator.EvaluatorANSYSWB                    mod.evaluator.EvaluatorANSYSAPDL
        method), 11                                               method), 10
evaluate() (datamod.evaluator.EvaluatorBenchmark          get_results()                                    (data-
        method), 11                                               mod.evaluator.EvaluatorANSYSWB method),
evaluate()            (datamod.evaluator.EvaluatorData            11
        method), 12                                       get_results_folders() (in module core.settings),
evaluate_metrics()              (in     module      meta-         4
        mod.performance), 25                              get_samples() (datamod.evaluator.EvaluatorData
evaluate_samples()              (core.surrogate.Surrogate         method), 12
        method), 7                                        GettingStarted (class in datamod.problems), 13
Evaluator (class in datamod.evaluator), 8
evaluator (core.model.Model attribute), 1                 H
EvaluatorANSYS (class in datamod.evaluator), 8            Halton (class in datamod.sampling), 15
EvaluatorANSYSAPDL (class in datamod.evaluator),          header_names() (in module datamod.results), 13
        9                                                 heatmap() (in module visumod.plots), 31
EvaluatorANSYSWB (class in datamod.evaluator), 10         history (metamod.ANN_pt.TrainHistory attribute), 21
40                                                                                                        Index
                                                                         Surrogate optimizer, Release 0.0.0
hp_optimized (core.surrogate.Surrogate attribute), 6      name (metamod.ANN_pt.ANN_pt attribute), 20
                                                          name (metamod.ANN_tf.ANN attribute), 22
I                                                         no_samples (core.surrogate.Surrogate attribute), 6
initializers (in module metamod.ANN_pt), 19               norm_in (datamod.get_data attribute), 17
input (datamod.get_data attribute), 17                    norm_out (datamod.get_data attribute), 17
input_param_name                                  (data- normalize() (in module datamod), 18
        mod.evaluator.EvaluatorANSYS          attribute),
        9                                                 O
invalid_param() (in module metamod.validation), Optimization (class in core.optimization), 2
        26                                                optimization (in module run), 30
iteration (datamod.evaluator.Evaluator attribute), 8 optimization_stats
iteration (datamod.evaluator.EvaluatorANSYSWB                     (core.optimization.Optimization        attribute),
        attribute), 10                                            3
iterations        (core.optimization.Optimization     at- optimize() (core.optimization.Optimization method),
        tribute), 2                                               3
                                                          optimize() (in module run), 30
L                                                         optimize_hyperparameters()
learning_curves() (in module visumod.plots), 31                   (core.surrogate.Surrogate method), 7
load_json() (in module core.settings), 4                  optimize_hyperparameters()              (in module meta-
load_object() (in module core.settings), 5                        mod),  27
load_problem() (in module datamod), 18                    optimized (metamod.ANN.ANN_base attribute), 19
load_results() (core.surrogate.Surrogate method),         optimized_to_samples           (core.surrogate.Surrogate
        7                                                         attribute), 6
load_results() (in module datamod.results), 14            optimod (module), 28
load_surrogate (in module run), 30                        optimod.performance (module), 28
log_dir (metamod.ANN.ANN_base attribute), 19              optimod.termination (module), 28
                                                          optimum_model (core.optimization.Optimization at-
M                                                                 tribute), 3
make_data_file() (in module datamod.results), 14          optimum_surrogate
make_response_files() (in module data-                            (core.optimization.Optimization        attribute),
        mod.results), 14                                          3
make_workfolder() (in module core.settings), 5            output         (datamod.evaluator.EvaluatorANSYSWB
MatlabPeaks (class in datamod.problems), 13                       attribute), 10
max_samples (in module core.surrogate), 5                 output  (datamod.get_data   attribute), 17
metamod (module), 26
metamod.ANN (module), 18                                  P
metamod.ANN_pt (module), 19                               pareto_fronts() (in module visumod.plots), 32
metamod.ANN_tf (module), 22                               pcp() (in module visumod.plots), 32
metamod.deploy (module), 24                               perform_optimization (in module run), 30
metamod.performance (module), 25                          plot_adaptive_candidates() (in module vi-
metamod.validation (module), 26                                   sumod), 33
Model (class in core.model), 1                            plot_raw() (in module visumod), 33
model (core.optimization.Optimization attribute), 2       plot_response()                (core.surrogate.Surrogate
model (core.surrogate.Surrogate attribute), 5                     method), 7
model (in module run), 30                                 plot_results()          (core.optimization.Optimization
model (metamod.ANN_pt.ANN_pt attribute), 20                       method), 3
model (metamod.ANN_tf.ANN attribute), 22                  plot_training_history() (in module visumod),
                                                                  34
N                                                         pretrain() (metamod.ANN_pt.ANN_pt method), 20
n_const (core.model.Model attribute), 1                   pretrain() (metamod.ANN_tf.ANN method), 23
n_const (core.optimization.Optimization attribute), 2     problem (core.optimization.Optimization attribute), 3
n_obj (core.model.Model attribute), 2                     problem (datamod.evaluator.EvaluatorBenchmark at-
name (core.surrogate.Surrogate attribute), 6                      tribute), 11
                                                          problem_ids (in module run), 30
Index                                                                                                            41
Surrogate optimizer, Release 0.0.0
problems (in module datamod.problems), 13               save_results (datamod.evaluator.Evaluator at-
prune_model() (metamod.ANN_tf.ANN method), 24                   tribute), 8
                                                        scale() (in module datamod), 18
R                                                       scale_samples() (in module datamod.sampling), 16
range_in (core.model.Model attribute), 1                scatter() (in module visumod.plots), 32
range_in (core.optimization.Optimization attribute), 2  scatter_pymoo() (in module visumod.plots), 32
range_in (datamod.get_data attribute), 18               scrape_license_info()                            (data-
range_norm (core.surrogate.Surrogate attribute), 6              mod.evaluator.EvaluatorANSYS          method),
range_out (datamod.get_data attribute), 18                      9
RealoadNotAnEvaluator              (class    in   data- set_algorithm() (in module optimod), 28
         mod.evaluator), 12                             set_optimization() (in module optimod), 29
ref_point (core.optimization.Optimization attribute),   set_problem()          (core.optimization.Optimization
         2                                                      method), 3
ref_points (in module core.optimization), 2             set_surrogate() (in module metamod), 27
reload() (core.surrogate.Surrogate method), 7           set_validation() (in module metamod.validation),
reload_info() (in module metamod), 27                           26
reload_surrogate() (in module run), 30                  set_validation_values()                         (meta-
reoptimization_ratio (core.surrogate.Surrogate                  mod.ANN.ANN_base method), 19
         attribute), 6                                  settings (in module core.settings), 4
report() (core.optimization.Optimization method), 3     setup (datamod.evaluator.EvaluatorANSYS attribute), 9
report() (core.surrogate.Surrogate method), 7           solve_problem() (in module optimod), 29
report_divergence()            (in     module     meta- source_file (datamod.evaluator.EvaluatorData at-
         mod.performance), 25                                   tribute), 12
res (core.optimization.Optimization attribute), 3       SparseModel (class in metamod.ANN_pt), 21
resample_adaptive()            (in      module    data- split_holdout() (in module metamod.validation),
         mod.sampling), 15                                      26
resample_static() (in module datamod.sampling),         split_kfold() (in module metamod.validation), 26
         15                                             split_methods (in module metamod.validation), 26
response (datamod.get_data attribute), 17               split_rlt() (in module metamod.validation), 26
response_grid() (in module datamod.sampling), 16        Squared (class in datamod.problems), 13
restart_check() (in module core.settings), 5            store() (metamod.ANN_pt.TrainHistory method), 22
results (datamod.evaluator.EvaluatorBenchmark at-       subnetworks (metamod.ANN_pt.SparseModel at-
         tribute), 11                                           tribute), 21
retrieve_metric()            (in      module      meta- surface_pymoo() (in module visumod.plots), 32
         mod.performance), 25                           Surrogate (class in core.surrogate), 5
RMSE() (in module metamod.performance), 25              surrogate (core.optimization.Optimization attribute),
run (module), 30                                                3
                                                        surrogate (core.surrogate.Surrogate attribute), 7
S                                                       surrogate (in module run), 30
sample() (core.surrogate.Surrogate method), 8           surrogate_response() (in module visumod), 34
sample() (in module datamod.sampling), 16               surrogates (core.surrogate.Surrogate attribute), 7
sample_adaptive() (in module datamod.sampling),         swish() (in module metamod.ANN_pt), 22
         16
sample_bounds (in module datamod.sampling), 15
                                                        T
sample_size_convergence() (in module vi-                tbd (metamod.ANN.ANN_base attribute), 18
         sumod), 34                                     template (datamod.evaluator.EvaluatorANSYSWB at-
samples (core.surrogate.Surrogate attribute), 7                 tribute), 10
sampling_iterations (core.surrogate.Surrogate           termination (core.optimization.Optimization at-
         attribute), 6                                          tribute), 2
samplings (in module datamod.sampling), 15              train() (core.surrogate.Surrogate method), 8
save() (core.surrogate.Surrogate method), 8             train_from_data (in module run), 30
save() (metamod.ANN_pt.ANN_pt method), 20               train_surrogate() (in module metamod), 27
save() (metamod.ANN_tf.ANN method), 24                  train_surrogate() (in module run), 30
save_figure() (in module visumod.plots), 32             trained (core.surrogate.Surrogate attribute), 6
42                                                                                                      Index
                                                      Surrogate optimizer, Release 0.0.0
TrainHistory (class in metamod.ANN_pt), 21
U
unnormalize_res() (in module optimod), 29
update_input()                                (data-
       mod.evaluator.EvaluatorANSYSAPDL
       method), 10
update_input()                                (data-
       mod.evaluator.EvaluatorANSYSWB method),
       11
update_settings() (in module core.settings), 5
V
valid_licences                                (data-
       mod.evaluator.EvaluatorANSYS       attribute),
       9
validation_points (metamod.ANN.ANN_base at-
       tribute), 19
verification (core.surrogate.Surrogate attribute), 6
verification_file (core.surrogate.Surrogate at-
       tribute), 6
verify() (core.optimization.Optimization method), 4
verify_results()          (in      module       opti-
       mod.performance), 28
vis_design_space() (in module visumod), 34
vis_objective_space() (in module visumod), 34
vis_objective_space_pcp() (in module vi-
       sumod), 34
visumod (module), 33
visumod.plots (module), 31
W
workbench_project                             (data-
       mod.evaluator.EvaluatorANSYSWB attribute),
       10
write_results() (in module datamod.results), 14
write_stats() (metamod.ANN.ANN_base method),
       19
Index                                                                                43
