Optimizers API¶
OptimizationProperty¶
Defines one optimization variable.
Fields include:
nametype(MODEL_INPUTorNETLIST_VARIABLE)min_valuemax_valuestep- optional
unit - optional
linked_to - optional
initial_value: the value the optimizer evaluates first
OptimizationType¶
MODEL_INPUT: variable passed to ONNX surrogate inputs.NETLIST_VARIABLE: variable patched directly in parsed netlist content.
DesignGoal and DesignParameter¶
DesignGoal combines:
- parameter enum (
DesignParameter), - optional min/max bounds,
- optional
frequency_range, - optional weight,
- optional
scale, the unit a miss of a bound is measured in.
Penalty is the mean over the goal's points of the squared bound violations, each divided by
scale; without one, by the bound (|bound|, or 1 for a bound of 0; see
deviation_scale). The mean keeps a band goal's share independent of its point count.
Each DesignParameter declares the analysis it needs, so goals are grouped by analysis and evaluated against the matching result. with_variant(parameter, variant) reads a parameter from an AnalysisVariant (the analysis run on the netlist with some values changed) instead, under the name <variant>:<name>. make_expression_parameter(name, expression, terms) builds an ExpressionParameter: a formula such as "a - b" over named terms (other parameters, possibly expressions themselves, possibly from different analyses), read at the goal's frequency and parsed by GoalExpression from a restricted grammar. Small-signal parameters (S-parameters, Lp, Qs, k, mu, SRF, …) read the .AC network; the spectrum parameters read the HB or transient spectrum:
| Factory | Parameter name | Description |
|---|---|---|
make_power_dbm(node, simulation_type) |
Power_dBm[<node>] |
Output power in dBm at an analysis point |
make_gain_db(port, amplitude, z0, node, simulation_type) |
Gain_dB[<port>@<node>] |
Transducer gain in dB referred to a port's drive level |
make_isolation_db(node, simulation_type) |
Isolation_dB[<node>] |
Margin in dB between the target line and the strongest other line |
simulation_type defaults to SimulationType.HB; passing SimulationType.TRAN evaluates the same quantity on the transient spectrum and prefixes the name with TRAN:. These are built per netlist rather than taken from the static catalogue, because the available nodes and ports differ per circuit. See Advanced -> Harmonic Balance and Advanced -> Transient Analysis.
OptunaOptimizer¶
Default optimizer wrapper for Optuna.
Typical options:
sampler:tpe,random,simulated_annealing,auto. TPE uses Optuna's defaults: multivariate for a single objective, independent for several; override them throughsampler_kwargs, e.g.{"multivariate": False}pruner:median,successive_halving,hyperbandmulti_objective: boolean
A parameter's initial_value makes the first trial evaluate it; the others
are sampled.
GradientDescentOptimizer¶
Used for local refinement workflows, including optional fine-tuning mode in COBRA. It is simultaneous-perturbation (SPSA) gradient descent in coordinates normalised to each parameter's range: every step probes the current point at ± a small distance along a random direction (two trials), then moves against the estimated gradient. Both distances shrink with every step. The point is kept unrounded, so steps below a parameter's grid still add up; only the proposals are rounded to it.
learning_rate: first step as a fraction of the range (default0.2)exploration_scale: probe distance;1probes at 10 % of the range, at least one grid step (default0.5)random_seed
It starts at the context's values (in EM fine-tuning, the design just
evaluated), else at each parameter's initial_value, else in the middle of the
range; a start not taken from the context is evaluated first. It needs the
result of one trial before it suggests the next, so parallel_trials must be 1.
Tip
Start with OptunaOptimizer and move to gradient descent only when you are refining near a known good region.