Skip to content

Commit

Permalink
Fix for ax batch_client
Browse files Browse the repository at this point in the history
Differential Revision: D15203695

fbshipit-source-id: d05fe14d80c245b1854ad1a56ae68a7491beaa5f
  • Loading branch information
Ashwin Murthy authored and facebook-github-bot committed May 3, 2019
1 parent 2366524 commit 6011bcb
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions ax/service/ax_client.py
Expand Up @@ -320,6 +320,17 @@ def _save_experiment_if_possible(self) -> bool:
)
return False

def _get_new_data(self) -> Data:
"""
Returns new data since the last run of the generator.
Returns:
Latest data.
"""
return Data.from_multiple_data(
[self.experiment.lookup_data_for_trial(idx) for idx in self._updated_trials]
)

def _suggest_new_trial(self) -> Trial:
"""
Suggest new candidate for this experiment.
Expand All @@ -330,9 +341,7 @@ def _suggest_new_trial(self) -> Trial:
Returns:
Trial with candidate.
"""
new_data = Data.from_multiple_data(
[self.experiment.lookup_data_for_trial(idx) for idx in self._updated_trials]
)
new_data = self._get_new_data()
generator_run = not_none(self.generation_strategy).gen(
experiment=self.experiment, new_data=new_data
)
Expand Down

0 comments on commit 6011bcb

Please sign in to comment.