Skip to content

Commit

Permalink
Internal change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 503283329
  • Loading branch information
rchen152 authored and learned_optimization authors committed Jan 19, 2023
1 parent 00eada0 commit 242e218
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion learned_optimization/population/mutators/fixed_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def update(self, state: Any,
steps = cache[worker.generation_id]

# grab the last checkpoint here.
last_checkpoint = steps.values()[-1]
last_checkpoint = steps.values()[-1] # pytype: disable=unsupported-operands
logging.info("Active worker: %s", str(worker))
logging.info("last checkpoint : %s", str(last_checkpoint))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def add_worker_to_cache(from_checkpoint: population.Checkpoint,
state["branch_checkpoint"] = steps[0]
state["center"] = steps[0].generation_id

last_checkpoint = steps.values()[-1]
last_checkpoint = steps.values()[-1] # pytype: disable=unsupported-operands

if state["phase"] == "exploit":
# switch to center.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,12 @@ def update(
return None, current_workers

if self._steps_per_exploit:
if (cache[genid].keys()[-1] -
cache[genid].keys()[0]) < self._steps_per_exploit:
if (
cache[genid].keys()[-1] - cache[genid].keys()[0] # pytype: disable=unsupported-operands
) < self._steps_per_exploit:
return None, current_workers

to_test = cache[genid].keys()[0] + self._steps_per_exploit
to_test = cache[genid].keys()[0] + self._steps_per_exploit # pytype: disable=unsupported-operands
valid_values = [
x.value
for (s, x) in cache[genid].items()
Expand Down

0 comments on commit 242e218

Please sign in to comment.