lczerolens.game#

Import the game module.

class lczerolens.game.BatchedPolicySampler(wrapper: lczerolens.model.wrapper.ModelWrapper, use_argmax: bool = True)#
class lczerolens.game.BoardDataset(file_name: str | None = None, boards: List[Board] | None = None, game_ids: List[str] | None = None)#

A class for representing a dataset of boards.

boards#

The list of boards.

Type:

List[chess.Board]

save(file_name: str, n_history: int = 0, indices=None)#

Save the dataset to a file.

Note

As the board needs to be unpiled use the preprocess_game method.

class lczerolens.game.GameDataset(file_name: str | None = None, games: List[Game] | None = None)#

A class for representing a dataset of games.

games#

The list of games.

Type:

List[Game]

class lczerolens.game.PolicySampler(wrapper: ModelWrapper, use_argmax: bool = True, alpha: float = 1.0, beta: float = 1.0, gamma: float = 1.0, draw_score: float = 0.0, m_max: float = 0.0345, m_slope: float = 0.0027, k_0: float = 0.0, k_1: float = 1.6521, k_2: float = -0.6521, q_threshold: float = 0.8)#
class lczerolens.game.SelfPlay(white: Sampler, black: Sampler)#

A class for generating games.

play(board: Board | None = None, max_moves: int = 100, to_play: bool = True, report_fn: Callable[[dict, bool], None] | None = None)#

Plays a game.

class lczerolens.game.WrapperSampler(wrapper: lczerolens.model.wrapper.ModelWrapper, use_argmax: bool = True, alpha: float = 1.0, beta: float = 1.0, gamma: float = 1.0, draw_score: float = 0.0, m_max: float = 0.0345, m_slope: float = 0.0027, k_0: float = 0.0, k_1: float = 1.6521, k_2: float = -0.6521, q_threshold: float = 0.8)#