# Trains Rigby's policy network. Run from anywhere: # powershell -ExecutionPolicy Bypass -File C:\Users\rektd\repos\Rigby\train\policy\train.ps1 # Extra arguments go to the trainer, e.g.: # ... train.ps1 --superbatches 60 --hidden 4096 --id rigby-policy-v2 # ... train.ps1 --check checkpoints\rigby-policy-40 # Data: ..\data\lc0\policy.binpack, made by fetch.ps1 (or by lc02monty + interleave). param([Parameter(ValueFromRemainingArguments = $true)] [string[]] $TrainerArgs) # Native tools report through exit codes; 'Stop' would turn cargo's progress # output on stderr into errors under Windows PowerShell. $ErrorActionPreference = 'Continue' Set-Location $PSScriptRoot . .\env.ps1 if (-not ($TrainerArgs -contains '--data') -and -not ($TrainerArgs -contains '--check') -and -not (Test-Path '..\data\lc0\policy.binpack')) { throw 'No training data: ..\data\lc0\policy.binpack is missing (run fetch.ps1)' } cargo build --release --bin rigby-policy if ($LASTEXITCODE -ne 0) { throw 'build failed' } & .\target\release\rigby-policy.exe @TrainerArgs exit $LASTEXITCODE