Files
foxhunt/archive/scripts/test_dqn_evaluation.sh
jgrusewski 2df1ea92e1 feat(ml): WAVE 29 DQN Codebase Cleanup & Refactoring Campaign
BREAKING CHANGES:
- Removed orphaned dqn.rs monolithic trainer (4,975 lines)
- Removed orphaned dqn_ensemble.rs module (816 lines)
- Removed orphaned tft.rs and tft_complete_int8_integration_test.rs
- TFT trainer split into modular directory structure

DQN Module Refactoring:
- Split trainers/dqn.rs into modular structure (config.rs, statistics.rs, trainer.rs)
- Fixed hyperopt 39D search space (continuous params only)
- Boolean flags (use_dueling, use_double_dqn, use_per, use_noisy_nets) are now FIXED architectural decisions
- use_distributional defaults to false (Candle BUG #36 - scatter_add gradient issues)

Clean Module Structure:
- ml/src/trainers/dqn/ directory with proper mod.rs exports
- ml/src/trainers/tft/ directory with config.rs, types.rs, model.rs, trainer.rs, tests.rs
- All P0 features validated: TD-error clamping, batch diversity, LR scheduler, priority staleness

Documentation:
- Added comprehensive docs in docs/codebase-cleanup/
- ADR-001 for DQN refactoring decisions
- Rainbow DQN component matrix and quick reference guides

Build Status: Compiles with zero errors

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-27 23:46:13 +01:00

65 lines
1.8 KiB
Bash
Executable File

#!/bin/bash
# Test script for DQN evaluation orchestrator
set -e # Exit on error
echo "=================================================="
echo "DQN Evaluation Orchestrator - Architecture Fix Test"
echo "=================================================="
echo ""
# Check if model file exists
MODEL_PATH="/tmp/dqn_final_model.safetensors"
DATA_PATH="test_data/ES_FUT_unseen.parquet"
if [ ! -f "$MODEL_PATH" ]; then
echo "❌ ERROR: Model file not found: $MODEL_PATH"
echo ""
echo "Please train the DQN model first:"
echo " cargo run -p ml --example train_dqn --release --features cuda"
exit 1
fi
if [ ! -f "$DATA_PATH" ]; then
echo "❌ ERROR: Test data not found: $DATA_PATH"
echo ""
echo "Please ensure test data exists:"
echo " ls -lh test_data/"
exit 1
fi
echo "✅ Prerequisites check passed"
echo " Model: $MODEL_PATH"
echo " Data: $DATA_PATH"
echo ""
# Run evaluation
echo "Running DQN evaluation..."
echo "Command: cargo run -p ml --example evaluate_dqn_main_orchestrator --release --features cuda -- \\"
echo " --model-path $MODEL_PATH \\"
echo " --parquet-file $DATA_PATH \\"
echo " --warmup-bars 50"
echo ""
cargo run -p ml --example evaluate_dqn_main_orchestrator --release --features cuda -- \
--model-path "$MODEL_PATH" \
--parquet-file "$DATA_PATH" \
--warmup-bars 50
EXIT_CODE=$?
echo ""
if [ $EXIT_CODE -eq 0 ]; then
echo "✅ Evaluation completed successfully!"
echo ""
echo "Expected output:"
echo " - ✅ DQN checkpoint loaded successfully (8 tensors)"
echo " - Model architecture: 225 → [128, 64, 32] → 3"
echo " - Action distribution (BUY/SELL/HOLD percentages)"
echo " - Latency statistics (P50, P95, P99)"
echo " - Production readiness check"
else
echo "❌ Evaluation failed with exit code: $EXIT_CODE"
exit $EXIT_CODE
fi