# Trains Rigby's value network. Run from anywhere: # powershell -ExecutionPolicy Bypass -File C:\Users\rektd\repos\Rigby\train\value\train.ps1 # Extra arguments go to the trainer, e.g.: # ... train.ps1 --superbatches 60 --id rigby-value-v2 # ... train.ps1 --data ..\data\a.binpack --data ..\data\b.binpack param([Parameter(ValueFromRemainingArguments = $true)] [string[]] $TrainerArgs) $ErrorActionPreference = 'Stop' Set-Location $PSScriptRoot # CUDA 13.3 (the toolkit bullet links against) and cargo $env:CUDA_PATH = 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.3' $env:PATH = "$env:USERPROFILE\.cargo\bin;$env:CUDA_PATH\bin\x64;$env:PATH" # The bullet clone the trainer builds against if (-not (Test-Path '..\..\..\bullet\crates\bullet_lib')) { throw 'bullet not found next to the Rigby repo: git clone https://github.com/jw1912/bullet C:\Users\rektd\repos\bullet' } # Default data: unpack the .zst once if only the compressed file is there $data = '..\data\test80-2024-02-feb-2tb7p.min-v2.v6.binpack' if (-not ($TrainerArgs -contains '--data') -and -not (Test-Path $data)) { if (-not (Test-Path "$data.zst")) { throw "No training data: $data(.zst) is missing" } Write-Host "Unpacking $data.zst ..." $src = (Resolve-Path "$data.zst").Path python -P -c "import zstandard,sys,os; s=sys.argv[1]; d=s[:-4]; zstandard.ZstdDecompressor().copy_stream(open(s,'rb'), open(d+'.part','wb'), read_size=1<<24, write_size=1<<24); os.replace(d+'.part', d)" $src } cargo build --release if ($LASTEXITCODE -ne 0) { throw 'build failed' } & .\target\release\rigby-value.exe @TrainerArgs if ($LASTEXITCODE -ne 0) { throw "training failed ($LASTEXITCODE)" } Write-Host '' Write-Host 'Done. Networks are in' (Resolve-Path .\checkpoints).Path