- Fixed PSO budget calculation bug in ml/src/hyperopt/optimizer.rs - Root cause: Division by n_particles in sequential execution - Now correctly calculates max_iters = remaining_trials (no division) - Result: 50 trials complete instead of 23 (100% vs 46%) - Added comprehensive DQN hyperopt results analysis - 39/50 trials analyzed across 2 RunPod deployments - Best hyperparameters identified: LR 4.89e-5 (ultra-low) - Created DQN_HYPEROPT_RESULTS_SUMMARY.md with expert validation - GitLab CI/CD pipeline operational (48 lines fixed) - Fixed YAML syntax errors (unquoted colons) - All 7 jobs validated and working - Warning cleanup complete (136 → 0 warnings) - Removed 143 lines dead code - Fixed visibility, unused imports, Debug traits - Archived Wave D reports to docs/archive/ - 8 early stopping reports moved - Root directory cleaned up 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
62 lines
2.2 KiB
Bash
Executable File
62 lines
2.2 KiB
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
echo "========================================="
|
|
echo "DQN Hyperopt Deployment (CORRECTED OBJECTIVE)"
|
|
echo "========================================="
|
|
echo ""
|
|
|
|
# Configuration
|
|
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
|
|
OUTPUT_DIR="dqn_hyperopt_corrected_${TIMESTAMP}"
|
|
|
|
echo "Configuration:"
|
|
echo " Objective: Episode rewards (CORRECTED from validation loss)"
|
|
echo " Trials: 50"
|
|
echo " Epochs per trial: 100"
|
|
echo " GPU: RTX A4000 ($0.25/hr)"
|
|
echo " Expected duration: 12-25 min"
|
|
echo " Expected cost: $0.05-$0.10"
|
|
echo " Output: /runpod-volume/ml_training/${OUTPUT_DIR}"
|
|
echo ""
|
|
|
|
# Verify Docker image is up-to-date
|
|
echo "Verifying Docker image..."
|
|
IMAGE_DATE=$(docker images jgrusewski/foxhunt-hyperopt:latest --format "{{.CreatedAt}}" | head -1)
|
|
echo " Image timestamp: ${IMAGE_DATE}"
|
|
echo " Expected: Nov 1, 2025 23:18+ (after fix)"
|
|
echo ""
|
|
|
|
# Deploy DQN hyperopt with CORRECTED objective
|
|
echo "Deploying DQN hyperopt pod..."
|
|
python3 scripts/python/runpod/runpod_deploy.py \
|
|
--gpu-type "RTX A4000" \
|
|
--image "jgrusewski/foxhunt-hyperopt:latest" \
|
|
--command "hyperopt_dqn_demo --parquet-file /runpod-volume/test_data/ES_FUT_180d.parquet --trials 50 --epochs 100 --base-dir /runpod-volume/ml_training/${OUTPUT_DIR}"
|
|
|
|
echo ""
|
|
echo "✅ DQN hyperopt deployment initiated (CORRECTED OBJECTIVE)"
|
|
echo "Monitor logs: python3 scripts/python/runpod/monitor_logs.py <pod_id>"
|
|
echo ""
|
|
echo "CRITICAL FIX APPLIED:"
|
|
echo " Previous objective: val_loss (WRONG - rewarded tiny batches)"
|
|
echo " New objective: -avg_episode_reward (CORRECT)"
|
|
echo ""
|
|
echo "Expected Results:"
|
|
echo " Batch size: Should vary widely (not stuck at 32-43)"
|
|
echo " Learning rate: Should optimize for actual learning"
|
|
echo " Episode rewards: Should maximize trading returns"
|
|
echo " Q-values: Should show proper value estimation"
|
|
echo ""
|
|
echo "Previous Issue (FIXED):"
|
|
echo " Tiny batch sizes (32-43) prevented learning"
|
|
echo " Q-values stayed near zero (noisy gradients)"
|
|
echo " Validation loss was artificially low (misleading)"
|
|
echo ""
|
|
echo "Next Steps:"
|
|
echo " 1. Monitor pod logs for trial progress"
|
|
echo " 2. Check best hyperparameters after completion"
|
|
echo " 3. Compare batch sizes to previous run (32-43)"
|
|
echo " 4. Verify Q-values and episode rewards improve"
|
|
echo ""
|