BandDPER (Escampe Evaluation Network)

Model Details

BandDPER (Dual-Perspective Evaluation ResNet) is a highly specialized PyTorch neural network designed to evaluate board states for the game of Escampe. It serves as a fast and accurate heuristic function for a Java-based Alpha-Beta minimax engine.

Because the model is deployed inside a lightweight Java client that computes inference without a dedicated tensor library, BandDPER is intentionally designed to be small, efficient, and mathematically simple to port. Notably, all BatchNorm parameters are fused into the adjacent Conv2D and Linear layers during export, completely eliminating the need for runtime batch normalization math in Java.

Model Architecture

The architecture processes the 6x6 Escampe board from a "Dual-Perspective" to retain spatial symmetry without requiring the network to learn perspective inversion:

  1. Shared Spatial Encoder: Both the current player's perspective tensor (x_me) and the opponent's perspective tensor (x_opp) are passed through a shared Convolutional feature extractor.
    • A standard 3x3 Conv2D layer extracts local patterns.
    • A Dilated 3x3 Conv2D layer (dilation=2) increases the receptive field to 5x5, allowing the network to easily "see" across the 6x6 board without requiring a deep, expensive ResNet.
    • The output is flattened and projected into a 128-dimensional embedding using a ClippedReLU (clamp(0, 1)) to ensure numerical stability.
  2. Feature Fusion: The two 128-d perspective embeddings are concatenated (yielding 256 dims) along with 2 highly predictive scalar signals: the number of escape squares available to the White Unicorn and the Black Unicorn.
  3. Residual Trunk: The 258-dimensional vector is processed by a stack of standard Multilayer Perceptron (MLP) Residual Blocks.
  4. Output Head: The final layers reduce the vector to a single [-1.0, 1.0] scalar evaluation using a tanh activation. Additionally, a direct "forced-pass" shortcut bypasses the entire residual trunk to severely penalize the evaluation if the current player has no legal moves.

Uses

Direct Use

This model is intended to be used as a static evaluation function for an Escampe minimax agent. It takes in a tensor representation of a board state and instantly predicts the expected heuristic outcome from the current player's perspective.

Downstream Use

The model weights are meant to be exported and fused using export.py, which folds batch normalization layers and exports raw weight arrays. These raw weights are then loaded into the DataExport.java or ClientJeu.java engine to evaluate nodes at the leaf of an Alpha-Beta search tree.

Training Details

  • Loss Function: Mean Squared Error (MSE) against the minimax-evaluated score.
  • Optimizer: AdamW with Gradient Clipping (clip_grad_norm_).
  • Scheduler: Cosine Annealing with Warm Restarts.
  • Data Representation: Instead of passing raw bitboards, the input data is heavily pre-processed into a 16x6x6 spatial tensor. Channels encode piece locations, strict band masks, departure constraints, forced-pass conditions, and a custom unicorn-relative opponent attacker map to assist the convolution layers.

Technical Specifications

  • Framework: PyTorch
  • Input Shape: Two [16, 6, 6] spatial tensors + 3 scalars.
  • Output Shape: [1] scalar bounded between [-1.0, 1.0].

Out-of-Scope Use

This model is tightly coupled to the rules, 6x6 dimensions, and band mechanics of Escampe. It cannot be used or transferred to evaluate other board games like Chess or Checkers without completely replacing the input tensor builder and retraining from scratch.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train Bluefir/BandDPER