Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to accomodate new API v2 #13

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions benchmark_utils/template_flamby_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,10 @@ def run(self, callback):
# We are reproducing the run method but this time a callback checks
# stopping-criterion at each round, which allows to cache computations
# and do a single run
while callback(strat.models_list[0].model):
self.final_model = strat.models_list[0].model
while callback():
strat.perform_round()
self.final_model = strat.models_list[0].model

self.final_model = strat.models_list[0].model

Expand All @@ -103,7 +105,7 @@ def get_result(self):
# The outputs of this function are the arguments of `Objective.compute`
# This defines the benchmark's API for solvers' results.
# it is customizable for each benchmark.
return self.final_model
return {"model": self.final_model}

# Not used if callback is used
@staticmethod
Expand Down
2 changes: 1 addition & 1 deletion objective.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def robust_metric(y_true, y_pred):
def get_one_result(self):
# Return one solution. The return value should be an object compatible
# with `self.compute`. This is mainly for testing purposes.
return self.model_arch()
return dict(model=self.model_arch())

def get_objective(self):
# Define the information to pass to each solver to run the benchmark.
Expand Down
Loading