Skip to contentSkip to Content

spires_opt_score

Struct controlling how the optimizer scores candidate reservoir configurations.


Definition

enum spires_metric_kind { SPIRES_METRIC_AUROC = 0, SPIRES_METRIC_AUPRC = 1 }; struct spires_opt_score { double lambda_var; double lambda_cost; int metric; int _reserved_i0; };

Fields

FieldTypeDescription
lambda_vardoublePenalty weight for cross-seed variance. The composite score is reduced by lambda_var * metric_std, where metric_std is the standard deviation of the metric across seeds. Higher values favor configurations with stable, reproducible performance. Must be non-negative. Typical range: 0.0 — 1.0.
lambda_costdoublePenalty weight for computational cost. The composite score is reduced by lambda_cost * relative_cost, where relative_cost is proportional to num_neurons. Higher values favor smaller, cheaper reservoirs. Must be non-negative. Typical range: 0.0 — 0.1.
metricintPerformance metric to optimize. Use one of the spires_metric_kind values: SPIRES_METRIC_AUROC (0) for Area Under the Receiver Operating Characteristic curve, or SPIRES_METRIC_AUPRC (1) for Area Under the Precision-Recall Curve.
_reserved_i0intReserved for future use. Must be set to 0.

Composite Score Formula

The optimizer ranks candidates by:

score = metric_mean - lambda_var * metric_std - lambda_cost * relative_cost

where:

  • metric_mean is the average of the selected metric across all seeds in a budget stage.
  • metric_std is the standard deviation across seeds.
  • relative_cost is a normalized measure of reservoir size (proportional to num_neurons).

Example

/* Optimize AUROC with moderate variance penalty, low cost penalty */ struct spires_opt_score score = { .lambda_var = 0.1, .lambda_cost = 0.01, .metric = SPIRES_METRIC_AUROC };
/* Optimize AUPRC for imbalanced datasets, no cost penalty */ struct spires_opt_score score = { .lambda_var = 0.2, .lambda_cost = 0.0, .metric = SPIRES_METRIC_AUPRC };

Notes

  • AUROC vs. AUPRC. AUROC is appropriate when positive and negative classes are roughly balanced. For highly imbalanced datasets (e.g., rare-event detection), AUPRC provides a more informative measure because it is sensitive to precision at low recall.
  • Setting lambda_var to 0. Disables the variance penalty. The optimizer will select the configuration with the highest mean metric, regardless of how much performance varies across random seeds.
  • Setting lambda_cost to 0. Disables the cost penalty. The optimizer will not penalize larger reservoirs, which may lead to selecting configurations with many neurons.
  • Reserved fields. Always zero-initialize _reserved_i0.

See Also

Last updated on