|
8184 | 8184 | "name": "stdout", |
8185 | 8185 | "output_type": "stream", |
8186 | 8186 | "text": [ |
8187 | | - "Experiment saved to test_save_and_load_experiment_04_exp.pkl\n", |
8188 | 8187 | "No tensorboard log created.\n", |
| 8188 | + "Attribute fun_control is picklable and will be included in the experiment file.\n", |
| 8189 | + "Attribute design_control is picklable and will be included in the experiment file.\n", |
| 8190 | + "Attribute optimizer_control is picklable and will be included in the experiment file.\n", |
| 8191 | + "Attribute surrogate_control is picklable and will be included in the experiment file.\n", |
| 8192 | + "Attribute eps is picklable and will be included in the experiment file.\n", |
| 8193 | + "Attribute fun is picklable and will be included in the experiment file.\n", |
| 8194 | + "Attribute rng is picklable and will be included in the experiment file.\n", |
| 8195 | + "Attribute lower is picklable and will be included in the experiment file.\n", |
| 8196 | + "Attribute k is picklable and will be included in the experiment file.\n", |
| 8197 | + "Attribute upper is picklable and will be included in the experiment file.\n", |
| 8198 | + "Attribute var_type is picklable and will be included in the experiment file.\n", |
| 8199 | + "Attribute var_name is picklable and will be included in the experiment file.\n", |
| 8200 | + "Attribute all_lower is picklable and will be included in the experiment file.\n", |
| 8201 | + "Attribute all_upper is picklable and will be included in the experiment file.\n", |
| 8202 | + "Attribute ident is picklable and will be included in the experiment file.\n", |
| 8203 | + "Attribute red_dim is picklable and will be included in the experiment file.\n", |
| 8204 | + "Attribute all_var_type is picklable and will be included in the experiment file.\n", |
| 8205 | + "Attribute all_var_name is picklable and will be included in the experiment file.\n", |
| 8206 | + "Attribute fun_evals is picklable and will be included in the experiment file.\n", |
| 8207 | + "Attribute fun_repeats is picklable and will be included in the experiment file.\n", |
| 8208 | + "Attribute max_time is picklable and will be included in the experiment file.\n", |
| 8209 | + "Attribute noise is picklable and will be included in the experiment file.\n", |
| 8210 | + "Attribute tolerance_x is picklable and will be included in the experiment file.\n", |
| 8211 | + "Attribute ocba_delta is picklable and will be included in the experiment file.\n", |
| 8212 | + "Attribute log_level is picklable and will be included in the experiment file.\n", |
| 8213 | + "Attribute show_models is picklable and will be included in the experiment file.\n", |
| 8214 | + "Attribute show_progress is picklable and will be included in the experiment file.\n", |
| 8215 | + "Attribute infill_criterion is picklable and will be included in the experiment file.\n", |
| 8216 | + "Attribute n_points is picklable and will be included in the experiment file.\n", |
| 8217 | + "Attribute max_surrogate_points is picklable and will be included in the experiment file.\n", |
| 8218 | + "Attribute progress_file is picklable and will be included in the experiment file.\n", |
| 8219 | + "Attribute tkagg is picklable and will be included in the experiment file.\n", |
| 8220 | + "Attribute verbosity is picklable and will be included in the experiment file.\n", |
| 8221 | + "Attribute de_bounds is picklable and will be included in the experiment file.\n", |
| 8222 | + "Attribute design is picklable and will be included in the experiment file.\n", |
| 8223 | + "Attribute optimizer is picklable and will be included in the experiment file.\n", |
| 8224 | + "Attribute surrogate is picklable and will be included in the experiment file.\n", |
| 8225 | + "Attribute X is picklable and will be included in the experiment file.\n", |
| 8226 | + "Attribute y is picklable and will be included in the experiment file.\n", |
| 8227 | + "Attribute counter is picklable and will be included in the experiment file.\n", |
| 8228 | + "Attribute min_y is picklable and will be included in the experiment file.\n", |
| 8229 | + "Attribute min_X is picklable and will be included in the experiment file.\n", |
| 8230 | + "Attribute min_mean_X is picklable and will be included in the experiment file.\n", |
| 8231 | + "Attribute min_mean_y is picklable and will be included in the experiment file.\n", |
| 8232 | + "Attribute mean_X is picklable and will be included in the experiment file.\n", |
| 8233 | + "Attribute mean_y is picklable and will be included in the experiment file.\n", |
| 8234 | + "Attribute var_y is picklable and will be included in the experiment file.\n", |
| 8235 | + "Picklable instance created: {'fun_control': {'PREFIX': 'test_save_and_load_experiment_04', 'CHECKPOINT_PATH': 'runs/saved_models/', 'DATASET_PATH': 'data/', 'RESULTS_PATH': 'results/', 'TENSORBOARD_PATH': 'runs/', 'TENSORBOARD_CLEAN': False, '_L_in': None, '_L_out': None, '_L_cond': None, '_torchmetric': None, 'accelerator': 'auto', 'converters': None, 'core_model': None, 'core_model_name': None, 'counter': 0, 'data': None, 'data_dir': './data', 'data_full_train': None, 'data_module': None, 'data_set': None, 'data_set_name': None, 'data_test': None, 'data_val': None, 'db_dict_name': None, 'design': None, 'device': None, 'devices': 'auto', 'enable_progress_bar': False, 'eval': None, 'force_run': True, 'fun_evals': 15, 'fun_repeats': 1, 'horizon': None, 'hyperdict': None, 'infill_criterion': 'y', 'k_folds': 3, 'log_every_n_steps': 50, 'log_graph': False, 'log_level': 50, 'loss_function': None, 'lower': array([-1, -1]), 'max_time': 1, 'max_surrogate_points': 30, 'metric_river': None, 'metric_sklearn': None, 'metric_sklearn_name': None, 'metric_torch': None, 'metric_params': {}, 'model_dict': {}, 'noise': False, 'n_points': 1, 'n_samples': None, 'n_total': None, 'num_nodes': 1, 'num_sanity_val_steps': 2, 'num_workers': 0, 'ocba_delta': 0, 'oml_grace_period': None, 'optimizer': None, 'path': None, 'penalty_NA': None, 'precision': '32', 'prep_model': None, 'prep_model_name': None, 'progress_file': None, 'save_experiment': True, 'save_result': True, 'save_model': False, 'scaler': None, 'scaler_name': None, 'scenario': None, 'seed': 123, 'show_batch_interval': 1000000, 'show_config': False, 'show_models': False, 'show_progress': True, 'shuffle': None, 'sigma': 0.0, 'spot_tensorboard_path': None, 'strategy': 'auto', 'target_column': None, 'target_type': None, 'task': None, 'tensorboard_log': False, 'tensorboard_start': False, 'tensorboard_stop': False, 'test': None, 'test_seed': 1234, 'test_size': 0.4, 'tkagg': False, 'tolerance_x': 0, 'train': None, 'upper': array([1, 1]), 'var_name': None, 'var_type': ['num'], 'verbosity': 2, 'weights': 1.0, 'weight_coeff': 0.0, 'weights_entry': None}, 'design_control': {'init_size': 7, 'repeats': 1}, 'optimizer_control': {'max_iter': 1000, 'seed': 125}, 'surrogate_control': {'log_level': 50, 'noise': False, 'model_optimizer': <function differential_evolution at 0x13a877f60>, 'model_fun_evals': 10000, 'min_theta': -3.0, 'max_theta': 2.0, 'n_theta': 2, 'p_val': 2.0, 'n_p': 1, 'optim_p': False, 'min_Lambda': 1e-09, 'max_Lambda': 1, 'seed': 124, 'theta_init_zero': True, 'var_type': ['num', 'num'], 'metric_factorial': 'canberra'}, 'eps': np.float64(1.4901161193847656e-08), 'fun': <bound method Analytical.fun_sphere of analytical(offset=0.0, sigma=0.0, seed=126)>, 'rng': Generator(PCG64) at 0x159EAAB20, 'lower': array([-1, -1]), 'k': 2, 'upper': array([1, 1]), 'var_type': ['num', 'num'], 'var_name': ['x0', 'x1'], 'all_lower': array([-1, -1]), 'all_upper': array([1, 1]), 'ident': array([False, False]), 'red_dim': np.False_, 'all_var_type': ['num', 'num'], 'all_var_name': ['x0', 'x1'], 'fun_evals': 15, 'fun_repeats': 1, 'max_time': 1, 'noise': False, 'tolerance_x': 0, 'ocba_delta': 0, 'log_level': 50, 'show_models': False, 'show_progress': True, 'infill_criterion': 'y', 'n_points': 1, 'max_surrogate_points': 30, 'progress_file': None, 'tkagg': False, 'verbosity': 2, 'de_bounds': [[np.int64(-1), np.int64(1)], [np.int64(-1), np.int64(1)]], 'design': <spotpython.design.spacefilling.SpaceFilling object at 0x159e7d190>, 'optimizer': <function differential_evolution at 0x13a877f60>, 'surrogate': <spotpython.build.kriging.Kriging object at 0x15992e270>, 'X': None, 'y': None, 'counter': 0, 'min_y': None, 'min_X': None, 'min_mean_X': None, 'min_mean_y': None, 'mean_X': None, 'mean_y': None, 'var_y': None}\n", |
| 8236 | + "Experiment saved to test_save_and_load_experiment_04_exp.pkl\n", |
8189 | 8237 | "Loaded experiment from test_save_and_load_experiment_04_exp.pkl\n", |
8190 | 8238 | "S: Spot\n", |
8191 | 8239 | "S_loaded: Spot\n", |
8192 | | - "<spotpython.spot.spot.Spot object at 0x14f48a240>\n" |
| 8240 | + "<spotpython.spot.spot.Spot object at 0x14ef77e60>\n", |
| 8241 | + "No spot_writer available.\n", |
| 8242 | + "spotpython tuning: 0.0054610613669814016 [#####-----] 53.33% \n", |
| 8243 | + "No spot_writer available.\n", |
| 8244 | + "spotpython tuning: 0.0009832082973447918 [######----] 60.00% \n", |
| 8245 | + "No spot_writer available.\n", |
| 8246 | + "spotpython tuning: 3.553659184723499e-05 [#######---] 66.67% \n", |
| 8247 | + "No spot_writer available.\n", |
| 8248 | + "spotpython tuning: 3.553659184723499e-05 [#######---] 73.33% \n", |
| 8249 | + "No spot_writer available.\n", |
| 8250 | + "spotpython tuning: 3.553659184723499e-05 [########--] 80.00% \n", |
| 8251 | + "No spot_writer available.\n", |
| 8252 | + "spotpython tuning: 3.553659184723499e-05 [#########-] 86.67% \n", |
| 8253 | + "No spot_writer available.\n", |
| 8254 | + "spotpython tuning: 3.553659184723499e-05 [#########-] 93.33% \n", |
| 8255 | + "No spot_writer available.\n", |
| 8256 | + "spotpython tuning: 3.553659184723499e-05 [##########] 100.00% Done...\n", |
| 8257 | + "\n", |
| 8258 | + "Experiment saved to test_save_and_load_experiment_04_res.pkl\n", |
| 8259 | + "No spot_writer available.\n", |
| 8260 | + "spotpython tuning: 0.0054610613669814016 [#####-----] 53.33% \n", |
| 8261 | + "No spot_writer available.\n", |
| 8262 | + "spotpython tuning: 0.0009832082973447918 [######----] 60.00% \n", |
| 8263 | + "No spot_writer available.\n", |
| 8264 | + "spotpython tuning: 3.553659184723499e-05 [#######---] 66.67% \n", |
| 8265 | + "No spot_writer available.\n", |
| 8266 | + "spotpython tuning: 3.553659184723499e-05 [#######---] 73.33% \n", |
| 8267 | + "No spot_writer available.\n", |
| 8268 | + "spotpython tuning: 3.553659184723499e-05 [########--] 80.00% \n", |
| 8269 | + "No spot_writer available.\n", |
| 8270 | + "spotpython tuning: 3.553659184723499e-05 [#########-] 86.67% \n", |
| 8271 | + "No spot_writer available.\n", |
| 8272 | + "spotpython tuning: 3.553659184723499e-05 [#########-] 93.33% \n", |
| 8273 | + "No spot_writer available.\n", |
| 8274 | + "spotpython tuning: 3.553659184723499e-05 [##########] 100.00% Done...\n", |
| 8275 | + "\n", |
| 8276 | + "Experiment saved to test_save_and_load_experiment_04_res.pkl\n", |
| 8277 | + "Loaded experiment from test_save_and_load_experiment_04_res.pkl\n", |
| 8278 | + "No spot_writer available.\n", |
| 8279 | + "spotpython tuning: 0.09066627114202976 [#####-----] 53.33% \n", |
| 8280 | + "No spot_writer available.\n", |
| 8281 | + "spotpython tuning: 0.09066626972235009 [######----] 60.00% \n", |
| 8282 | + "No spot_writer available.\n", |
| 8283 | + "spotpython tuning: 0.09066626838073348 [#######---] 66.67% \n", |
| 8284 | + "No spot_writer available.\n", |
| 8285 | + "spotpython tuning: 0.09066626689421296 [#######---] 73.33% \n", |
| 8286 | + "No spot_writer available.\n", |
| 8287 | + "spotpython tuning: 0.09066626491590751 [########--] 80.00% \n", |
| 8288 | + "No spot_writer available.\n", |
| 8289 | + "spotpython tuning: 0.09066626191827036 [#########-] 86.67% \n", |
| 8290 | + "No spot_writer available.\n", |
| 8291 | + "spotpython tuning: 0.09066625628125086 [#########-] 93.33% \n", |
| 8292 | + "No spot_writer available.\n", |
| 8293 | + "spotpython tuning: 0.09066624187947465 [##########] 100.00% Done...\n", |
| 8294 | + "\n", |
| 8295 | + "Experiment saved to test_save_and_load_experiment_04_res.pkl\n" |
8193 | 8296 | ] |
8194 | 8297 | }, |
8195 | 8298 | { |
8196 | | - "ename": "AttributeError", |
8197 | | - "evalue": "'NoneType' object has no attribute 'fit'", |
8198 | | - "output_type": "error", |
8199 | | - "traceback": [ |
8200 | | - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
8201 | | - "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)", |
8202 | | - "Cell \u001b[0;32mIn[1], line 99\u001b[0m\n\u001b[1;32m 96\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m np\u001b[38;5;241m.\u001b[39marray_equal(S_loaded\u001b[38;5;241m.\u001b[39my, S\u001b[38;5;241m.\u001b[39my):\n\u001b[1;32m 97\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mResponse vector mismatch: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mS_loaded\u001b[38;5;241m.\u001b[39my\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m != \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mS\u001b[38;5;241m.\u001b[39my\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m---> 99\u001b[0m \u001b[43mS_loaded\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrun\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 101\u001b[0m S\u001b[38;5;241m.\u001b[39mrun()\n\u001b[1;32m 102\u001b[0m S_loaded_2 \u001b[38;5;241m=\u001b[39m load_result(PREFIX)\n", |
8203 | | - "File \u001b[0;32m~/miniforge3/envs/spot312/lib/python3.12/site-packages/spotpython/spot/spot.py:814\u001b[0m, in \u001b[0;36mSpot.run\u001b[0;34m(self, X_start)\u001b[0m\n\u001b[1;32m 812\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39minitialize_design(X_start)\n\u001b[1;32m 813\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mupdate_stats()\n\u001b[0;32m--> 814\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfit_surrogate\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 815\u001b[0m timeout_start \u001b[38;5;241m=\u001b[39m time\u001b[38;5;241m.\u001b[39mtime()\n\u001b[1;32m 816\u001b[0m \u001b[38;5;28;01mwhile\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mshould_continue(timeout_start):\n", |
8204 | | - "File \u001b[0;32m~/miniforge3/envs/spot312/lib/python3.12/site-packages/spotpython/spot/spot.py:1495\u001b[0m, in \u001b[0;36mSpot.fit_surrogate\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 1493\u001b[0m X_S \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mX\n\u001b[1;32m 1494\u001b[0m y_S \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39my\n\u001b[0;32m-> 1495\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msurrogate\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfit\u001b[49m(X_S, y_S)\n\u001b[1;32m 1496\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 1497\u001b[0m logger\u001b[38;5;241m.\u001b[39mwarning(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mX and y have different sizes. Surrogate not fitted.\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n", |
8205 | | - "\u001b[0;31mAttributeError\u001b[0m: 'NoneType' object has no attribute 'fit'" |
8206 | | - ] |
| 8299 | + "data": { |
| 8300 | + "text/plain": [ |
| 8301 | + "<spotpython.spot.spot.Spot at 0x159f41d30>" |
| 8302 | + ] |
| 8303 | + }, |
| 8304 | + "execution_count": 1, |
| 8305 | + "metadata": {}, |
| 8306 | + "output_type": "execute_result" |
8207 | 8307 | } |
8208 | 8308 | ], |
8209 | 8309 | "source": [ |
|
8263 | 8363 | " PREFIX=PREFIX,\n", |
8264 | 8364 | " lower=np.array([-1, -1]),\n", |
8265 | 8365 | " upper=np.array([1, 1]),\n", |
8266 | | - " verbosity=1\n", |
| 8366 | + " verbosity=2,\n", |
| 8367 | + " log_level=50\n", |
8267 | 8368 | ")\n", |
8268 | 8369 | "\n", |
8269 | 8370 | "design_control = design_control_init(init_size=7)\n", |
|
8273 | 8374 | "S = Spot(\n", |
8274 | 8375 | " fun=fun,\n", |
8275 | 8376 | " fun_control=fun_control,\n", |
8276 | | - " design_control=design_control,\n", |
| 8377 | + " design_control=design_control\n", |
8277 | 8378 | ")\n", |
8278 | 8379 | "\n", |
8279 | 8380 | "# Load the experiment\n", |
|
0 commit comments