<jupyter_start><jupyter_text>**NOTE: load all auxiliary files from the folder aux_m in the auxiliary folder in this notebook in order to run this notebook**<jupyter_code>from numpy import *
import pandas as pd
import random
import nlopt
import numpy as np
import matplotlib.pyplot as plt
import numbers
import math
import seaborn as sns
import random
import autograd.numpy as ag
from autograd import grad
from mpl_toolkits.mplot3d import Axes3D
from numpy.lib.function_base import vectorize
from autograd import value_and_grad
np.set_printoptions(precision=20)
pd.set_option("display.precision", 14)
from auxiliary.aux_m.test_problems import *
from auxiliary.aux_m.test_problems_info import *
from auxiliary.aux_m.optimization_function_nlopt import *
from auxiliary.aux_m.function_get_start_point import *<jupyter_output><empty_output><jupyter_text>Griewank<jupyter_code>starting_points_griewank='./Results/results_griewank/Starting_points_griewank/start_points_correct_grw.csv'
start_p_griewank=pd.read_csv(starting_points_griewank)
#start_p_griewank
griewank_info_object=griewank_info(10,200)
griewank_info_object.solver_function_value
problem_griewank
algorithm_list=(nlopt.GN_CRS2_LM,nlopt.GN_ISRES,nlopt.GN_ESCH,nlopt.GN_MLSL,nlopt.GN_MLSL,34,34,nlopt.GN_MLSL_LDS)
algorithm_list
path_griewank='./Results/results_griewank/algo_results'
file_names_griewank=('CRS2_grw','ISRES_grw','ESCH_grw','MLSL_nm_3_grw','MLSL_nm_8_grw','MLSL_bob_3_grw',
                     'MLSL_bob_8_grw','MLSL_LDS_grw')
local_tolerance_x_list_grw=(None,None,None,1e-3,1e-8,1e-3,1e-8,1e-8)
local_tolerance_f_list_grw=(None,None,None,-inf,-inf,-inf,-inf,-inf)
computational_budgets=pd.array([500,750,1000,1100,1500,2000,2500,5000,7500,10000,11000,12000,15000,20000,25000,30000,37500,40000,45000,50000,60000,65000,75000,80000,90000,95000,99000,100000])
np.random.seed(905)

automate_result_generation(f=problem_griewank,
                           computational_budget=computational_budgets,
                           algo_list=algorithm_list,x_0=start_p_griewank,n=10,
                           problem_info=griewank_info_object,x_tol_abs=1e-4,f_tol_abs=1e-6,
                           path=path_griewank,file_names=file_names_griewank,
                           local_tolerance_x_list=local_tolerance_x_list_grw,
                           local_tolerance_f_list=local_tolerance_f_list_grw)


###### again do the optimization for all MLSL algorithms as we had a bug to get correct results
algorithm_list_1=(nlopt.GN_MLSL,nlopt.GN_MLSL,34,34,nlopt.GN_MLSL_LDS)
file_names_griewank_1=('MLSL_nm_3_grw','MLSL_nm_8_grw','MLSL_bob_3_grw',
                       'MLSL_bob_8_grw','MLSL_LDS_grw')
local_tolerance_x_list_1=(1e-3,1e-8,1e-3,1e-8,1e-8)
##local_tolerance_f_list_1=(-inf,-inf,-inf,-inf,-inf) ####vorherige Einstellung
local_tolerance_f_list_1=(1e-3,1e-8,1e-3,1e-8,1e-8)

local_tolerance_f_list_1
np.random.seed(915) ### seed vorher 907 ###seed 2: 913

automate_result_generation(f=problem_griewank,
                           computational_budget=computational_budgets,
                           algo_list=algorithm_list_1,x_0=start_p_griewank,n=10,
                           problem_info=griewank_info_object,x_tol_abs=1e-4,f_tol_abs=1e-6,
                           path=path_griewank,file_names=file_names_griewank_1,
                           local_tolerance_x_list=local_tolerance_x_list_1,
                           local_tolerance_f_list=local_tolerance_f_list_1)<jupyter_output><empty_output><jupyter_text>Rastrigin<jupyter_code>rastrigin_info_object=rastrigin_info(10,A=10)
np.random.seed(175)
starting_points_rastrigin=get_starting_points(10,rastrigin_info_object,100)

starting_points_rastrigin
starting_points_rastrigin.to_csv('./Results/results_rastrigin/starting_points_rast/start_points_rastrigin_1.csv')
starting_points_rastrigin
problem_rastrigin
problem_rastrigin(np.array([0,0,0]))
algorithm_list=(nlopt.GN_CRS2_LM,nlopt.GN_ISRES,nlopt.GN_ESCH,nlopt.GN_MLSL,nlopt.GN_MLSL,34,34,nlopt.GN_MLSL_LDS)
algorithm_list
path_rastrigin='./Results/results_rastrigin/results_algo_rast'
file_names_rastrigin=('CRS2_ras','ISRES_ras','ESCH_ras','MLSL_nm_3_ras','MLSL_nm_8_ras','MLSL_bob_3_ras',
                     'MLSL_bob_8_ras','MLSL_LDS_ras')
local_tolerance_x_list=(None,None,None,1e-3,1e-8,1e-3,1e-8,1e-8)
local_tolerance_f_list=(None,None,None,1e-3,1e-8,1e-3,1e-8,1e-8)
computational_budgets=pd.array([500,750,1000,1100,1500,2000,2500,5000,7500,10000,11000,12000,15000,20000,25000,30000,37500,40000,45000,50000,60000,65000,75000,80000,90000,95000,99000,100000])
np.random.seed(236)

automate_result_generation(f=problem_rastrigin,
                           computational_budget=computational_budgets,
                           algo_list=algorithm_list,
                           x_0=starting_points_rastrigin,
                           n=10,
                           problem_info=rastrigin_info_object,
                           x_tol_abs=1e-4,
                           f_tol_abs=1e-6,
                           path=path_rastrigin,
                           file_names=file_names_rastrigin,
                           local_tolerance_x_list=local_tolerance_x_list,
                           local_tolerance_f_list=local_tolerance_f_list)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09689629068887207, 'fraction_numerical': 0.07797123391370174, 'mean_word_length': 4.392857142857143, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '384127', 'license': 'MIT', 'n_tokens_mistral': 2300, 'n_tokens_neox': 2042, 'n_words': 175, 'path': 'data/dat_generation_files/final_dat_generation Kopie.ipynb', 'repo_name': 'OpenSourceEconomics/ose-scientific-computing-course-wirecard', 'size': '5284'}