Skip to content

Commit

Permalink
Fix an issue in state recovery for pg.early_stopping.StepWise.
Browse files Browse the repository at this point in the history
Previously the gate predicate was applied on a Trial object, instead, it should be applied on a Measurement object.

PiperOrigin-RevId: 565092585
  • Loading branch information
daiyip authored and pyglove authors committed Sep 13, 2023
1 parent 11f5df1 commit 808ca8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyglove/ext/early_stopping/step_wise.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def recover(self, history: Iterable[pg.tuning.Trial]):
# For the last measurement of a pending trial, we use gate
# predicate to determine the stopping decision.
gate_predicate = self.plan[next_gate][1]
stopping_decision = gate_predicate(t, gate_history)
stopping_decision = gate_predicate(m, gate_history)
gate_history.append(m)
self._trial_gate_decision[t.id] = (next_gate, stopping_decision)
next_gate += 1
Expand Down

0 comments on commit 808ca8e

Please sign in to comment.