-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtraining_progress.sh
More file actions
executable file
·66 lines (56 loc) · 2.11 KB
/
training_progress.sh
File metadata and controls
executable file
·66 lines (56 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
# PokerAI Progress Estimator
TOTAL_HANDS=200000
PHASE_1_HANDS=10000
# Get current progress
if [ -f "training_metrics.csv" ]; then
lines=$(wc -l < training_metrics.csv)
current_hands=$((lines-1)) # Subtract header
else
current_hands=0
fi
# Get training start time
if ps aux | grep "python.*train.py" | grep -v grep > /dev/null; then
start_time=$(ps -o lstart= -C python | grep train.py | head -1)
if [ ! -z "$start_time" ]; then
start_seconds=$(date -d "$start_time" +%s)
current_seconds=$(date +%s)
elapsed_seconds=$((current_seconds - start_seconds))
elapsed_hours=$((elapsed_seconds / 3600))
elapsed_minutes=$(( (elapsed_seconds % 3600) / 60 ))
fi
fi
# Calculate progress
if [ $current_hands -gt 0 ]; then
progress_percent=$((current_hands * 100 / TOTAL_HANDS))
hands_per_second=$(echo "scale=2; $current_hands / $elapsed_seconds" | bc 2>/dev/null || echo "0")
if [ $(echo "$hands_per_second > 0" | bc 2>/dev/null) -eq 1 ]; then
remaining_hands=$((TOTAL_HANDS - current_hands))
eta_seconds=$(echo "scale=0; $remaining_hands / $hands_per_second" | bc 2>/dev/null || echo "0")
eta_hours=$((eta_seconds / 3600))
eta_minutes=$(( (eta_seconds % 3600) / 60 ))
fi
fi
# Display progress
echo "🎯 PokerAI Training Progress"
echo "============================"
echo "Target: $TOTAL_HANDS hands"
echo "Current: $current_hands hands"
echo "Progress: ${progress_percent:-0}%"
if [ ! -z "$elapsed_hours" ]; then
echo "Elapsed: ${elapsed_hours}h ${elapsed_minutes}m"
fi
if [ ! -z "$eta_hours" ]; then
echo "ETA: ${eta_hours}h ${eta_minutes}m remaining"
fi
# Phase information
if [ $current_hands -lt $PHASE_1_HANDS ]; then
echo "Phase: 1/2 (CFR Training)"
echo "Phase Progress: $((current_hands * 100 / PHASE_1_HANDS))% of Phase 1"
else
phase2_progress=$(( (current_hands - PHASE_1_HANDS) * 100 / (TOTAL_HANDS - PHASE_1_HANDS) ))
echo "Phase: 2/2 (RL-CFR Hybrid)"
echo "Phase Progress: ${phase2_progress}% of Phase 2"
fi
echo
echo "💡 CFR training (Phase 1) is slower - expect faster progress in Phase 2"