/** * KataGo neural network input encoder. * * Produces the binary spatial feature planes consumed by KataGo's ONNX model. * Based on KataGo v1.14 input format ("v5" features): * * bin_input_global_ncplane [1, C, N, N] float32 * global_input [1, 19] float32 * * Feature plane layout (C = 22): * 0 current player stones * 1 opponent stones * 2 current player stones T-1 * 3 opponent stones T-1 * 4 current player stones T-2 * 5 opponent stones T-2 * 6 current player stones T-3 * 7 opponent stones T-3 * 8 current player stones T-4 * 9 opponent stones T-4 * 10 current player stones T-5 * 11 opponent stones T-5 * 12 current player stones T-6 * 13 opponent stones T-6 * 14 ko point (current player may not play here) * 15 board edge / padding (1 outside board) * 16 1 if board is 9×9 or smaller * 17 1 if board is 13×13 or smaller * 18 1 if board is 19×19 * 19 always-1 layer * 20 next-is-second-pass (pass-alive ko) * 21 positional superko (0 for simplified version) * * Global input features (19 values): * 0 komi / 15 (normalised) * 1-7 (reserved / zero for simplified version) */ import { KataGoBoard } from "./KataGoBoard.js"; export declare const KATAGO_INPUT_PLANES = 22; export declare const KATAGO_GLOBAL_FEATURES = 19; export interface KataGoTensors { /** Float32Array of shape [1, PLANES, N, N] */ binInput: Float32Array; /** Float32Array of shape [1, 19] */ globalInput: Float32Array; } /** * Encode the current board state into KataGo input tensors. * * @param board - The KataGoBoard instance (tracks history internally). * @param komi - Game komi (e.g. 6.5 or 7.5). */ export declare function encodePosition(board: KataGoBoard, komi?: number): KataGoTensors; /** * Decode the policy logits output from KataGo. * * KataGo outputs policy over N*N + 1 moves (last = pass). * Returns a list of (move_index, probability) pairs sorted by probability. */ export declare function decodePolicy(policyLogits: Float32Array, boardSize: number): Array<{ index: number; prob: number; gtp: string; }>; //# sourceMappingURL=KataGoEncoder.d.ts.map