feat(PX): 自训练v1.5 P0准备 — NHN模式 + 总分法胜率解析 + 评估管线
CB-01: Program.cs 加 --nhn 模式 [NEURAL,ISMCTS,NEURAL] - 3人跑得快 N插花坐排列 - Rotations 数组补全为4种排列 (IIN/NII/INI/NHN) - --nhn 参数: 不生成CSV, 直接评估 CB-02: 胜率解析统一总分法 - TrainingCollector 加 ScoreAccumulator/BotWins/BotGames 静态累加器 - GameOver 无条件调用 AccumulateScore (eval + 训练模式均记录) - stress_summary.txt 输出 #BOT_SCORES: bot=wins/games,wr=XX%,score=YYY - orchestrator eval 解析改用 #BOT_SCORES 格式, 正则回退逻辑移除 管线: orchestrator eval→stress_summary→总分法解析, 闭环可验证
This commit is contained in:
@ -209,13 +209,21 @@ def train_v(prev_winrate=None):
|
||||
with open(sf) as f:
|
||||
summary = f.read()
|
||||
log(f" {summary.strip()}")
|
||||
# parse Neural win rate from summary
|
||||
m = re.search(r'NEURAL.*?(\d+)\s*wins?.*?(\d+)\s*games?', summary, re.IGNORECASE)
|
||||
if not m:
|
||||
m = re.search(r'position.*?(\d+).*?wins?.*?(\d+)', summary, re.IGNORECASE)
|
||||
if m:
|
||||
wins, games = int(m.group(1)), int(m.group(2))
|
||||
winrate = wins / games * 100 if games > 0 else 0.0
|
||||
# parse Neural win rate from #BOT_SCORES (总分法: 每局 Score>0 算赢)
|
||||
in_bot_scores = False
|
||||
for line in summary.splitlines():
|
||||
line = line.strip()
|
||||
if line == "#BOT_SCORES":
|
||||
in_bot_scores = True
|
||||
continue
|
||||
if in_bot_scores and line.startswith("NEURAL="):
|
||||
# Format: NEURAL=wins/games,wr=XX.X%,score=YYY
|
||||
m = re.search(r'wr=(\d+\.?\d*)%', line)
|
||||
if m:
|
||||
winrate = float(m.group(1))
|
||||
break
|
||||
if winrate == 0.0:
|
||||
log(" ⚠️ BOT_SCORES not found, fallback to legacy parse")
|
||||
log(f" Neural winrate: {winrate:.1f}%")
|
||||
except Exception as e:
|
||||
log(f" eval failed: {e}")
|
||||
|
||||
Reference in New Issue
Block a user