Skip to content

Commit

Permalink
error with resume larger than doe
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikOrm committed Nov 10, 2023
1 parent f403718 commit f5b4251
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions hypermapper/bo/bo.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,23 @@ def main(settings, black_box_function=None):
settings["design_of_experiment"]["doe_type"],
allow_repetitions=settings["design_of_experiment"]["allow_repetitions"],
)
default_doe_data_array = param_space.run_configurations(
torch.cat(
(

default_doe_parameter_array = torch.cat((
default_parameter_array.reshape(-1, param_space.dimension),
doe_parameter_array.reshape(-1, param_space.dimension)
), 0)
if default_doe_parameter_array.shape[0] > 0:
default_doe_data_array = param_space.run_configurations(
torch.cat((
default_parameter_array.reshape(-1, param_space.dimension),
doe_parameter_array.reshape(-1, param_space.dimension),
),
0,
),
beginning_of_time,
settings,
black_box_function,
)
doe_parameter_array.reshape(-1, param_space.dimension)
), 0),
beginning_of_time, settings, black_box_function
)
else:
default_doe_data_array = DataArray(
torch.Tensor(), torch.Tensor(), torch.Tensor(), torch.Tensor(), torch.Tensor()
)
data_array.cat(default_doe_data_array)
absolute_configuration_index = data_array.len
iteration_number = max(
Expand Down Expand Up @@ -164,6 +169,8 @@ def main(settings, black_box_function=None):
"End of DoE - Time %10.4f sec\n" % (time.time() - doe_t0)
)

if data_array.len == 0:
raise Exception("Cannot run Hypermapper without any initial data.")
################################################
# MAIN LOOP
################################################
Expand Down

0 comments on commit f5b4251

Please sign in to comment.