Files
foxhunt/config/training/dqn-hyperopt.toml
jgrusewski af940671bc feat: reward config pipeline — DQNHyperparameters + TOML profiles
Add 7 composite reward fields to DQNHyperparameters: w_dsr, w_pnl,
w_dd, w_idle, dd_threshold, loss_aversion, time_decay_rate.

Add RewardSection to training_profile.rs with Option<f64> fields and
apply_to() mapping. Add [reward] section to all 3 DQN TOML profiles
(production, smoketest, hyperopt) with identical defaults.

Remove hold_reward from ExperienceSection (replaced by w_idle).
Add 7 reward search bounds to SearchSpaceSection and bound() match.
Add 7 reward phase_fast defaults to PhaseFastSection.

hold_penalty kept as deprecated field for hyperopt adapter compat
(Task 4 will clean it up).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 20:50:23 +01:00

112 lines
2.9 KiB
TOML

# DQN Hyperopt Profile — PSO search space definition
# All bounds are [min, max] ranges. The adapter reads these at runtime.
# To constrain the search space, narrow the ranges here — no code changes needed.
[search_space]
# Base parameters
learning_rate = [0.00001, 0.0003] # log scale in adapter
batch_size = [64, 512]
gamma = [0.88, 0.99]
buffer_size = [50000, 100000] # log scale in adapter
max_position_absolute = [1.0, 4.0]
huber_delta = [10.0, 40.0] # log scale in adapter
entropy_coefficient = [0.05, 0.5]
transaction_cost_multiplier = [0.5, 2.0]
per_alpha = [0.4, 0.8]
per_beta_start = [0.2, 0.6]
# Rainbow DQN extensions
v_range = [10.0, 50.0] # symmetric: v_min=-v_range, v_max=+v_range
noisy_sigma_init = [0.1, 1.0] # log scale in adapter
dueling_hidden_dim = [128, 512]
n_steps = [3, 5]
num_atoms = [11, 51] # 11=RTX3050, 51=H100 default (101 is 2x slower for marginal benefit)
# Weight decay
weight_decay = [0.0001, 0.01] # log scale in adapter
# Kelly risk parameters
kelly_fractional = [0.25, 0.75]
kelly_max_fraction = [0.1, 0.5]
# Volatility
volatility_window = [10, 30]
# Soft update
tau = [0.005, 0.01] # log scale in adapter
# Network sizing
hidden_dim_base = [128, 256] # capped at production default: 512 is 4x slower for marginal benefit
# CQL regularization
cql_alpha = [0.0, 1.0]
# Training dynamics
lr_decay_type = [0, 2] # discrete: 0=constant, 1=linear, 2=cosine
dsr_eta = [0.001, 0.05] # log scale in adapter
minimum_profit_factor = [1.1, 2.0]
# Exploration
count_bonus_coefficient = [0.0, 0.3]
# Risk-adjusted returns
sharpe_weight = [0.0, 0.5]
# Branching DQN
branch_hidden_dim = [64, 256]
# Gradient accumulation
gradient_accumulation_steps = [1, 1] # fixed at 1 for now
# IQN dual-head
iqn_lambda = [0.0, 2.0]
# Composite reward weights
w_dsr = [0.1, 2.0]
w_pnl = [0.0, 1.0]
w_dd = [0.0, 5.0]
w_idle = [0.0, 0.1]
dd_threshold = [0.01, 0.10]
loss_aversion = [1.0, 3.0]
time_decay_rate = [0.0001, 0.005]
[reward]
w_dsr = 1.0
w_pnl = 0.3
w_dd = 1.0
w_idle = 0.01
dd_threshold = 0.02
loss_aversion = 1.5
time_decay_rate = 0.0005
[fixed]
use_branching = true # GPU pipeline requires branching
use_double_dqn = true
use_per = true
use_distributional = true
[pso]
swarm_size = 20
max_iterations = 50
inertia = 0.7
cognitive = 1.5
social = 1.5
# Two-phase hyperopt: Phase 1 fixes architecture to small network,
# searches only learning dynamics (~15D). Phase 2 fixes best dynamics
# from Phase 1 JSON, searches architecture (~5D).
# See: docs/superpowers/specs/2026-03-22-two-phase-hyperopt-design.md
[phase_fast]
hidden_dim_base = 128
num_atoms = 11
branch_hidden_dim = 64
dueling_hidden_dim = 128
v_range = 20.0
w_dsr = 1.0
w_pnl = 0.3
w_dd = 1.0
w_idle = 0.01
dd_threshold = 0.02
loss_aversion = 1.5
time_decay_rate = 0.0005