Files
foxhunt/deploy_ppo_hyperopt.sh
jgrusewski 3853988af7 feat(hyperopt): Complete DQN hyperopt analysis and PSO optimizer fix
- 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>
2025-11-02 21:49:07 +01:00

60 lines
2.1 KiB
Bash
Executable File

#!/bin/bash
set -e
echo "========================================="
echo "PPO Hyperopt Deployment (CORRECTED OBJECTIVE)"
echo "========================================="
echo ""
# Configuration
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
OUTPUT_DIR="ppo_hyperopt_corrected_${TIMESTAMP}"
echo "Configuration:"
echo " Objective: Episode rewards (CORRECTED from validation loss)"
echo " Trials: 50"
echo " Episodes per trial: 2000"
echo " GPU: RTX A4000 ($0.25/hr)"
echo " Expected duration: 10-20 min"
echo " Expected cost: \$0.04-\$0.08"
echo " Output: /runpod-volume/ml_training/${OUTPUT_DIR}"
echo ""
# Verify Docker image contains fix
echo "Verifying Docker image..."
docker images jgrusewski/foxhunt-hyperopt:latest --format "table {{.Repository}}\t{{.Tag}}\t{{.CreatedAt}}"
echo ""
# Check for .venv activation
if [[ -z "$VIRTUAL_ENV" ]]; then
echo "ERROR: Virtual environment not activated"
echo "Run: source .venv/bin/activate"
exit 1
fi
# Deploy PPO hyperopt with CORRECTED objective
echo "Deploying PPO hyperopt with CORRECTED objective function..."
python3 scripts/runpod_deploy.py \
--gpu-type "RTX A4000" \
--image "jgrusewski/foxhunt-hyperopt:latest" \
--command "hyperopt_ppo_demo --parquet-file /runpod-volume/test_data/ES_FUT_180d.parquet --trials 50 --episodes 2000 --base-dir /runpod-volume/ml_training/${OUTPUT_DIR} --early-stopping-min-epochs 50"
echo ""
echo "✅ PPO hyperopt deployment initiated (CORRECTED OBJECTIVE)"
echo ""
echo "CRITICAL FIX APPLIED:"
echo " Previous objective: val_policy_loss + val_value_loss (WRONG)"
echo " New objective: -avg_episode_reward (CORRECT)"
echo ""
echo "Expected Results:"
echo " Policy LR: Should vary widely (not stuck at 1e-6)"
echo " Value LR: Should optimize for actual learning"
echo " Episode rewards: Should maximize trading returns"
echo " Clip epsilon: Should find sweet spot for policy updates"
echo ""
echo "Next Steps:"
echo " 1. Monitor logs: python3 scripts/runpod_deploy.py --monitor <pod_id>"
echo " 2. Verify results in S3: aws s3 ls s3://se3zdnb5o4/models/ --profile runpod --recursive"
echo " 3. Compare hyperparameters to previous frozen policy (policy_lr=1e-6)"
echo ""