Class JanusAgeMoea2CmixCptSampler
- Namespace
- OptunaSharp.Samplers
- Assembly
- OptunaSharp.dll
AGE-MOEA-2-CPT with JANUS-style CMIX candidate generation — the conditional-parameter sibling of
JanusAgeMoea2CmixSampler and the JANUS-augmented sibling of AgeMoea2CptSampler.
AGE-MOEA-2 keeps full control of its adaptive-geometry survival, the ConditionalParams
rules keep branch-defined parameters in the evolved space, and — past a warm-up — a small fraction of
children are replaced by an inverse-curvature Gaussian sample drawn from the recent window
(component_losses residuals or a diagonal-quadratic scalar fallback).
When CMIX contributes nothing. The CMIX engine needs an all-numeric relative search space (it cannot transform categoricals). On a categorical-dominant or conditional-categorical space the gate never fires and this sampler is exactly AgeMoea2CptSampler — which is the intended, useful behavior for that setting (the value is AGE-MOEA-2's survival + CPT, not the infill). Reserve the CMIX layer for continuous multi-objective problems; see JanusMooCmixSampler for the CMIX parameters and the PCG64 RNG divergence.
public sealed class JanusAgeMoea2CmixCptSampler : AgeMoea2CptSampler
- Inheritance
-
JanusAgeMoea2CmixCptSampler
- Inherited Members
Constructors
JanusAgeMoea2CmixCptSampler(int, int?, double, string, double, double, double, int, int?, string, string, BaseMutation?, double?, BaseCrossover?, double, double, ConditionalParams?)
Configures curvature-informed candidate injection into an AGE-MOEA-2-CPT population.
public JanusAgeMoea2CmixCptSampler(int populationSize = 50, int? seed = null, double cmixProb = 0.02, string cmixWindow = "auto", double cmixRidge = 1, double cmixLambda = 1, double cmixSigma = 0.002, int cmixStartGeneration = 3, int? cmixStartTrial = 100, string componentAttr = "component_losses", string scalarFallback = "diag_quadratic", BaseMutation? mutation = null, double? mutationProb = null, BaseCrossover? crossover = null, double crossoverProb = 0.9, double swappingProb = 0.5, ConditionalParams? conditionalParams = null)
Parameters
populationSizeintAGE-MOEA-2 population size (default 50).
seedint?Random seed (seeds AGE-MOEA-2, its independent sampler, and — separately — the CMIX stream).
cmixProbdoubleProbability a child is replaced by a CMIX sample past the warm-up (default 0.02). Ineffective on a non-numeric space (the gate cannot fire there).
cmixWindowstringRecent-window size for the metric fit:
"auto"(= 3·populationSize) or an integer string.cmixRidgedoubleRidge regularization for the metric regression (default 1.0).
cmixLambdadoubleLevenberg–Marquardt damping added before inverting the metric (default 1.0).
cmixSigmadoubleNormalized step size scaling the inverse-curvature covariance (default 0.002).
cmixStartGenerationintWarm-up in generations, used only when
cmixStartTrialisnull(default 3).cmixStartTrialint?Warm-up in trials before CMIX may fire;
nullderives it fromcmixStartGeneration(default 100).componentAttrstringUser-attribute key the CMIX metric reads each trial's residual vector from. The default is
component_losses, the keytrial.SetComponentLosseswrites.A custom key is read exactly as given, so store the vector with
trial.SetUserAttr(componentAttr, …). Only the default key also accepts the legacyraealias.CMIX fits the component metric only when every trial in its window carries a numeric vector under this key; otherwise it uses
scalarFallback.nullturns the component channel off.scalarFallbackstringScalar metric when no components are present:
diag_quadratic(default) ornone.mutationBaseMutationAGE-MOEA-2 mutation (forwarded;
null= the polynomial default, eta 20).mutationProbdouble?AGE-MOEA-2 mutation probability (forwarded;
null=1 / n_active_params).crossoverBaseCrossoverAGE-MOEA-2 crossover (forwarded;
null= SBX, eta 15).crossoverProbdoubleAGE-MOEA-2 crossover probability (forwarded, default 0.9).
swappingProbdoubleAGE-MOEA-2 swapping probability (forwarded, default 0.5).
conditionalParamsConditionalParamsActivation rules for branch-defined parameters, forwarded to AgeMoea2CptSampler.
nullmakes the host a plain AgeMoea2Sampler under the CMIX layer.
Exceptions
- ValueError
Population size is below two or the crossover parent count, or a configured reproduction probability is invalid.
Methods
SampleRelative(Study, FrozenTrial, OrderedDict<string, BaseDistribution>)
Sample parameters in a given search space.
The trial invokes this method lazily when it first needs relative parameters and caches the result for its remaining suggestions. This method is suitable for sampling algorithms that use relationship between parameters such as Gaussian Process and CMA-ES.
public override OrderedDict<string, object?> SampleRelative(Study study, FrozenTrial trial, OrderedDict<string, BaseDistribution> searchSpace)
Parameters
studyStudyStudy supplying trial history, directions, and storage.
trialFrozenTrialCurrent trial snapshot; copy it before modifying its contents.
searchSpaceOrderedDict<string, BaseDistribution>Distributions returned by InferRelativeSearchSpace(Study, FrozenTrial).
Returns
- OrderedDict<string, object>
Jointly sampled external parameter values; omitted parameters use independent sampling.