Documentation
¶
Index ¶
Constants ¶
const ( DefaultOptimizerWindowCap = 10 DefaultOptimizerWarmupTicks = 2 * DefaultOptimizerWindowCap DefaultQueueSoftThreshold = 1000.0 DefaultQueuePenaltyWeight = 1.5 DefaultLatencyPenaltyWeight = 0.3 DefaultQueuePenaltyClamp = -2.0 DefaultRewardClamp = 2.0 DefaultSafetyConsumeRatio = 0.7 DefaultLogEveryTicks = 20 DefaultMinApplyInterval = 2_000_000_000 // 2s in nanoseconds (time.Duration) DefaultErrorPenaltyWeight = 2.0 DefaultErrorPenaltyThresh = 0.01 DefaultEmergencyRollbackDR = 0.5 DefaultEmergencyRollbackN = 2 )
Variables ¶
This section is empty.
Functions ¶
func ClipAction ¶
func Denormalize ¶
Types ¶
type DDPG ¶
type DDPG struct {
// contains filtered or unexported fields
}
DDPG implements Deep Deterministic Policy Gradient. Actor: state → action (tanh); Critic: (state, action) → Q-value.
func (*DDPG) ResetNoise ¶
func (d *DDPG) ResetNoise()
func (*DDPG) SetNoiseDecay ¶
type Optimizer ¶
type Optimizer struct {
// contains filtered or unexported fields
}
Optimizer runs the DDPG training loop on Lasso-selected broker parameters.
func NewOptimizer ¶
func NewOptimizer(b *broker.Broker, params []TunableParam, optCfg OptimizerConfig, pilot ...PilotData) *Optimizer
type OptimizerConfig ¶
type OptimizerConfig struct {
Interval time.Duration
BatchSize int
WarmupTicks int
LearningRate float64
Hysteresis float64
NoiseDecay float64 // per-step multiplicative decay for OUNoise sigma (default 0.999)
NoiseFloor float64 // minimum sigma value (default 0.05)
}
func DefaultOptimizerConfig ¶
func DefaultOptimizerConfig() OptimizerConfig
type PilotData ¶
type PilotData struct {
Configs [][]float64 // each row: one config vector (len == NumTunableParams)
Throughputs []float64 // observed throughput per config
Alpha float64 // L1 regularisation strength
}
PilotData holds results from pilot runs used for Lasso calibration.
type TunableParam ¶
type TunableParam struct {
Name string
Min float64
Max float64
Weight float64 // Lasso-derived importance (0 = excluded from DDPG action space)
}
func ActiveParams ¶
func ActiveParams(all []TunableParam) []TunableParam
func CalibrateWeights ¶
func CalibrateWeights(params []TunableParam, configs [][]float64, throughputs []float64, alpha float64) []TunableParam
CalibrateWeights runs Lasso regression on pilot run data to determine which parameters actually affect throughput. Params with zero Lasso weight are excluded from the DDPG action space, reducing dimensionality.
configs: matrix of pilot configurations (each row = one run, len(row) == len(params)) throughputs: observed throughput for each pilot config alpha: L1 regularisation strength (higher => more parameters zeroed out)
func DefaultTunableParams ¶
func DefaultTunableParams() []TunableParam