Skip to content

Commit 5b9d514

Browse files
authored
Apply suggestions from code review
1 parent 082bded commit 5b9d514

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

optimas/gen_functions.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ def persistent_generator(H, persis_info, gen_specs, libE_info):
9696
# Check how many simulations have returned
9797
n = len(calc_in["sim_id"])
9898
# Feed the latest simulation results to the generator
99-
trials = []
10099
for i in range(n):
101100
trial_index = int(calc_in["trial_index"][i])
102101
trial_status = calc_in["trial_status"][i]
@@ -109,10 +108,6 @@ def persistent_generator(H, persis_info, gen_specs, libE_info):
109108
ev = Evaluation(parameter=par, value=y)
110109
trial.complete_evaluation(ev)
111110
generator.tell_trials([trial])
112-
trials.append(trial)
113-
114-
# Register trials with unknown SEM
115-
# generator.tell_trials(trials) # Give as batch
116111

117112
# Set the number of points to generate to that number:
118113
number_of_gen_points = min(n + n_failed_gens, max_evals - n_gens)

optimas/generators/ax/developer/multitask.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,17 +196,12 @@ def __init__(
196196
model_save_period: Optional[int] = 5,
197197
model_history_dir: Optional[str] = "model_history",
198198
) -> None:
199-
# SH note for standardization
200199
# As trial parameters these get written to history array
201200
# Ax trial_index and arm toegther locate a point
202201
# Multiple points (Optimas trials) can share the same Ax trial_index
203-
# Standard (VOCS) does not have equiv. of trial parameters -> would be variables.
204-
# If want to use _id can have a mapping inside the generator, but those
205-
# points that are part of same ax trial_index will not be seen in history.
206202
custom_trial_parameters = [
207203
TrialParameter("arm_name", "ax_arm_name", dtype="U32"),
208204
TrialParameter("trial_type", "ax_trial_type", dtype="U32"),
209-
# SH changed from trial_index to ax_trial_id - trial_index is usually Optimas index?
210205
TrialParameter("ax_trial_id", "ax_trial_index", dtype=int),
211206
]
212207
self._check_inputs(varying_parameters, objectives, lofi_task, hifi_task)
@@ -289,7 +284,7 @@ def suggest(self, num_points: Optional[int]) -> List[dict]:
289284

290285
def ingest(self, results: List[dict]) -> None:
291286
"""Incorporate evaluated trials into experiment."""
292-
# reconstruct Optimastrials
287+
# reconstruct Optimas trials
293288
trials = []
294289
for result in results:
295290
trial = Trial.from_dict(

0 commit comments

Comments
 (0)