← Back to list

rl-training
by sdd330
⭐ 0🍴 0📅 Jan 18, 2026
SKILL.md
name: rl-training description: Reinforcement learning training for CTF-AI. Use when training DQN agents, adjusting hyperparameters, debugging training issues, analyzing rewards, or improving AI performance. allowed-tools: Read, Bash(python:), Bash(pip:), Grep, Glob
Reinforcement Learning Training Skill
You are an expert in reinforcement learning, specifically Deep Q-Networks (DQN) for game AI.
Project Context
This CTF-AI project uses:
- DQN Agent with Double DQN, Prioritized Experience Replay, Huber loss
- 19-dimensional state vector: player(5) + target(6) + enemy(4) + global(4)
- 3 actions: DEFENCE(0), SCORING(1), SAVING(2)
- Gymnasium environment for training interface
- PyTorch for neural network
Key Files
backend/lib/reinforcement_learning/agent.py- DQNAgent classbackend/lib/reinforcement_learning/network.py- Neural network architecturebackend/lib/reinforcement_learning/reward_calculator.py- Reward functionbackend/lib/reinforcement_learning/state_extractor.py- Feature extractionbackend/lib/reinforcement_learning/training/train_gym.py- Training script
When Asked to Train
# Offline training
python3 -m lib.reinforcement_learning.training.train_gym 8080 --algorithm CustomDQN --train-offline
# Online training (requires game server)
python3 -m lib.reinforcement_learning.training.train_gym 34712 --algorithm CustomDQN
Hyperparameter Guidelines
| Parameter | Default | Tuning Advice |
|---|---|---|
| Learning rate | 0.0005 | Lower (0.0001) if unstable, higher (0.001) if slow |
| Epsilon decay | 0.998 | Slower (0.999) for more exploration |
| Gamma | 0.99 | Lower (0.95) for shorter-term focus |
| Batch size | 32 | Larger (64, 128) for more stable gradients |
| Target update | 50 | More frequent (20) for faster learning |
Debugging Training Issues
- Reward not improving: Check reward_calculator.py, ensure rewards are balanced
- Q-values exploding: Enable gradient clipping, reduce learning rate
- Agent stuck in one action: Increase exploration (epsilon), check state features
- Training unstable: Enable Double DQN, use Huber loss, increase buffer size
Reward Tuning
Current reward structure:
- Score flag: +150 (primary objective)
- Pick up flag: +10
- Lose flag: -40
- Get captured: -25
- Step penalty: -0.02
Adjust in reward_calculator.py if agent behavior is suboptimal.
Score
Total Score
60/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon