Skip to content

feat: add nearest-better clustering to the Torch backend - #7

Open
WojtAcht wants to merge 1 commit into
mainfrom
feat/differentiable-nbc
Open

WojtAcht wants to merge 1 commit into
mainfrom
feat/differentiable-nbc

Conversation

@WojtAcht

Copy link
Copy Markdown
Member

No description provided.

…entiable surrogates

The exact nbc.* group now has Torch calculators. The graph is selected under
no_grad and the selected edge lengths are recomputed from x, so the four
distance features carry a design gradient. With a fixed design they stay
locally constant in y, because the fitness ordering picks the edges and the
spacing does not; nbc.nb_fitness.cor is the exception and differentiates
through y at a locally fixed graph.

Add nbc_soft.*, five differentiable surrogates, in both backends. A smooth
first-success distribution over distance-ordered candidates replaces the
discrete "first strictly better neighbour" search, which restores a usable
gradient with respect to y for all five statistics, including the distance
ratios that the exact group cannot provide. Weights and the no-better mass
partition each row exactly, and every soft quantity converges to its exact
counterpart as the temperature approaches zero for distinct objective values.

The gates rank the objectives rather than min-max scaling them, and this is
fixed rather than configurable. Measured on BBOB d=2 with n=250d across six
functions, min-max gates diverged from the exact features 2.4 to 7.8 times
further at every temperature tested, and both are invariant to a positive
affine change of y, so nothing was traded away. The default temperature of
0.003 is the measured balance point: divergence of nbc_soft.nn_nb.sd_ratio
sits near one standard deviation of the exact feature's own design-to-design
sampling noise, while a tenth of it concentrates 98% of the gradient norm onto
5% of the observations against 89% at the default.

Two documented gaps: equal objective values gate at 1/2 at every temperature,
so plateaus do not reproduce the exact equal-fitness fallback, and a surrogate
value is only comparable to a target computed at the same temperature and
sample size. Report the exact group on fresh designs.

Information content deliberately keeps no Torch calculator, so it stays usable
as a held-out family that gradient training cannot reach.
Copilot AI balanced review requested due to automatic review settings September 21, 2026 18:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
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