Skip to content

Factor permutation management in a class#558

Merged
mtrofin merged 3 commits into
google:mainfrom
mtrofin:main
May 27, 2026
Merged

Factor permutation management in a class#558
mtrofin merged 3 commits into
google:mainfrom
mtrofin:main

Conversation

@mtrofin
Copy link
Copy Markdown
Collaborator

@mtrofin mtrofin commented May 21, 2026

Besides factoring, this also addresses 2 problems:

  • when pruning, in the antithetic case, we need to prune the pair. The optimizers expect that
  • adjusting weights by the same distribution misses the scale of the weight. this favors, then, tuning small weights.

@mtrofin mtrofin requested a review from boomanaiden154 May 21, 2026 16:51
@mtrofin mtrofin force-pushed the main branch 3 times, most recently from 301aad4 to e0b1cfc Compare May 21, 2026 16:57
Comment thread compiler_opt/es/blackbox_learner.py
self._is_antithetic = is_antithetic
self._rng = np.random.default_rng(seed=seed)

def get_next_perturbations(self) -> list[npt.NDArray[np.float32]]:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Are these necessarily next? There's no actual state here.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but every time you call it you get something else. next suggests that.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

next to me implies state. Maybe something like new would work better?

Comment thread compiler_opt/es/blackbox_optimizers.py Outdated
Copy link
Copy Markdown
Collaborator

@boomanaiden154 boomanaiden154 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@mtrofin mtrofin merged commit 0c454e8 into google:main May 27, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants