#!/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