feat(problems): gradients for batch 10b's functions, and gradients and constraint values through Shifted and Rotated - #420
Merged
Conversation
Fourteen of batch 10b's functions now provide their gradient through `FitnessFunction::provides` and `evaluate_with`: the sum of different powers, the quartic without noise, the two penalized functions, the high-conditioned elliptic, the bent cigar, the discus, BBOB's different powers, Büche-Rastrigin, Weierstrass, HappyCat, HGBat, Schaffer F7 and the rotated hyper-ellipsoid. At a kink of measure 0 (the cones and cusps of different powers, HappyCat, HGBat and Schaffer F7), the kinked term's gradient is 0, as Ackley's at its cone. No gradient for the step function and the non-continuous Rastrigin (flat steps), Katsuura (kinks 2^-33 apart) and the noisy quartic, whose genome-seeded noise jumps between any two genomes. Each is checked with `gradient::check` at random points; Büche-Rastrigin with Richardson's extrapolation at finer steps, and Weierstrass on its partial sums, whose highest terms no differences resolve.
…otated `Shifted<P>` and `Rotated<P>` now provide what the wrapped problem provides. A shift passes the extras of `x - o` through unchanged; a rotation evaluates at `c + M (x - c)` and turns the gradient back by the chain rule, `M^T grad f`, and each row of the constraints' Jacobian likewise (`J M`). A shifted or rotated G06 keeps its constraint values for MMA and Bayesian optimization. The `problems` docs now say which functions supply gradients, and what the wrappers pass on.
… Rust `gx.problems.Shifted` and `gx.problems.Rotated` wrap their problem in an adapter that forwarded only the fitness, so the wrappers lost its gradient and constraint values. It now forwards `provides` and `evaluate_with`: `gx.Lbfgsb(..., gradients="supplied")` runs on a shifted and rotated elliptic with its analytic gradient, and `gx.Bo` sees a shifted or rotated G24's constraints as its own. The problems' docs say which functions have a gradient, and what the wrappers pass on.
…ted pass on AGENTS.md, docs/features.md and the plan no longer say that the CEC- and BBOB-style functions and the wrappers have no gradient: they list the seven functions without one and the wrappers' chain rule. The wrapper docs say that a constrained problem's values reach `Bo`, and `Mma` only with their Jacobian, which MMA requires.
18 tasks done
Merged
tachsin
pushed a commit
that referenced
this pull request
Oct 2, 2026
## 🤖 New release * `genoxide`: 0.13.0 -> 0.13.1 (✓ API compatible changes) * `genoxide-python`: 0.13.0 -> 0.13.1 <details><summary><i><b>Changelog</b></i></summary><p> ## `genoxide` <blockquote> ## [0.13.1](v0.13.0...v0.13.1) - 2026-10-02 ### <!-- 0 -->Added - shift and rotation wrappers and seventeen CEC- and BBOB-style functions, each with its own example ([#409](#409)) - *(moead)* MOEA/D-DE, differential evolution in place of the crossover (Li and Zhang 2009) ([#418](#418)) - the constrained DTLZ8 and DTLZ9, the DC-DTLZ and the DAS-CMOP problems, each with its own example ([#414](#414)) - *(problems)* gradients for batch 10b's functions, and gradients and constraint values through Shifted and Rotated ([#420](#420)) - *(problems)* binary and combinatorial problems, batch 12, each with its own example ([#421](#421)) ### <!-- 4 -->Documentation - *(ctp)* CTP1-CTP8 checked against the published paper and Deb's 2001 book ([#419](#419)) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #416.
Analytic gradients for 14 of batch 10b's functions (
FitnessFunction::provides,evaluate_with):How they behave at the awkward points:
evaluate, so it is identical to the bit.No gradient, each with its reason in the docs:
Wrappers:
Shiftedpasses the wrapped problem's extras through unchanged.Rotatedreturns Mᵀ∇f(y) and J·M for the constraint Jacobian, at y = c + M(x − c).provides()reflects the wrapped problem's, so a shifted or rotated G06 keeps its constraint values, for Bayesian optimization.Tests:
gradient::checkat 200 random points per function, within 5e-8 beyond the differences' own rounding.gx.Lbfgsb, andgx.Bowith a wrapped G24.