io-chess
UCI chess engine
Loading...
Searching...
No Matches
dataset Namespace Reference

Classes

class  ChessMoEFactorizedDataset
class  ChessExpertFactorizedDataset

Functions

 decode_feature_row (row, feature_layout, planes_per_type, packed_offsets, packed_branch_planes, num_bypass_planes)

Variables

list PLANES_PER_GROUP_CONST = [4, 4, 5, 5, 5, 4, 4, 4, 5, 5, 5, 4]
list PACKED_OFFSETS_CONST
 parser = argparse.ArgumentParser()
 help
 type
 int
 default
 args = parser.parse_args()
 ds = ChessMoEFactorizedDataset(args.data_dir, max_samples=args.max, n_globals=args.n_globals)
 sample = ds[0]

Detailed Description

@file dataset.py
@brief Dataset utilities for training model.py on packed factorized features.

Loads packed factorized records produced by preprocessing in --factorized mode:
  - features.bin: PackedFactorizedInput
  - labels.bin: WDLOutput (3 floats: win, draw, loss)
  - expert_weights.bin: 6 floats [base0-3, survivor, killer]

PackedFactorizedInput C++ layout (alignas(64)):
    uint8_t branches[54][64]   # only used branch planes (4/5 per group)
  uint8_t bypass[12][64]
  float   global[32]

Function Documentation

◆ decode_feature_row()

decode_feature_row ( row,
feature_layout,
planes_per_type,
packed_offsets,
packed_branch_planes,
num_bypass_planes )
Here is the caller graph for this function:

Variable Documentation

◆ args

dataset.args = parser.parse_args()

◆ default

dataset.default

◆ ds

dataset.ds = ChessMoEFactorizedDataset(args.data_dir, max_samples=args.max, n_globals=args.n_globals)

◆ help

dataset.help

◆ int

dataset.int

◆ PACKED_OFFSETS_CONST

list dataset.PACKED_OFFSETS_CONST
Initial value:
= [
sum(PLANES_PER_GROUP_CONST[:i]) for i in range(len(PLANES_PER_GROUP_CONST))
]

◆ parser

dataset.parser = argparse.ArgumentParser()

◆ PLANES_PER_GROUP_CONST

list dataset.PLANES_PER_GROUP_CONST = [4, 4, 5, 5, 5, 4, 4, 4, 5, 5, 5, 4]

◆ sample

dataset.sample = ds[0]

◆ type

dataset.type