Skip to content

Commit

Permalink
Change variable names.
Browse files Browse the repository at this point in the history
  • Loading branch information
KanaiYuma-aist committed Mar 7, 2024
1 parent eeddf35 commit 49e835b
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions aiaccel/hpo/samplers/nelder_mead_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,7 @@ def __init__(
)

self.running_trial_id: list[int] = []
self.stack: dict[int, float] = {}

def is_within_range(self, coordinates: np.ndarray) -> bool:
return all(low < x < high for x, (low, high) in zip(coordinates, self._search_space.values()))
self.result_stack: dict[int, float] = {}

def infer_relative_search_space(self, study: Study, trial: FrozenTrial) -> dict[str, BaseDistribution]:
return {}
Expand All @@ -167,16 +164,16 @@ def before_trial(self, study: Study, trial: FrozenTrial) -> None:

def _get_params(self) -> np.ndarray:
while True:
coordinate = self.nm.get_vertex()
params = self.nm.get_vertex()

if coordinate is None:
if params is None:
raise RuntimeError("No more parallel calls to ask() are possible.")

if all(low < x < high for x, (low, high) in zip(coordinate, self._search_space.values())):
if all(low < x < high for x, (low, high) in zip(params, self._search_space.values())):
break
else:
self.nm.put_value(np.inf)
return coordinate
return params

def sample_independent(
self,
Expand Down

0 comments on commit 49e835b

Please sign in to comment.