exp: does the organism learn how a piece moves
Reachability in relative-offset space, not absolute squares: the CPPN sees only r_ij, so an entity's representation is translation-invariant and an absolute-square target is unanswerable by construction. In offset space a knight's L is eight cells. The floor is 'every piece moves like the average piece', which is the control the question needs: beating it means the model tells a pawn from a bishop. Precision is also reported per piece type, since pawns are half the board and can carry the aggregate on their own. --edges type puts the receiving piece's type into e_ij, the spec's own channel into the CPPN. Without it the kernel is type-blind: type reaches it only as an elementwise product.
This commit is contained in:
2 files changed
+208
-1
No files matched your search
+2
-1
@@ -58,6 +58,7 @@ class Ply:
|
||||
true_dest: int # index into dests
|
||||
past: np.ndarray # (N, 2*hist) each entity's previous squares, as displacements
|
||||
mask: np.ndarray # (N, N) the attack/defend graph, symmetric, self-loops on
|
||||
reach: np.ndarray # (N,) each entity's attack set as a bitboard, for chess_reach.py
|
||||
|
||||
|
||||
def advance_ids(board: chess.Board, move: chess.Move, piece: chess.Piece,
|
||||
@@ -131,7 +132,7 @@ def plies(game: chess.pgn.Game, hist: int = 3) -> list[Ply]:
|
||||
for t in legal], dtype=np.float32)
|
||||
j = legal.index(move.to_square)
|
||||
out.append(Ply([id_at[s] for s in squares], attrs, coords, mover, dests[j], dests, j,
|
||||
past, mask))
|
||||
past, mask, bb.copy()))
|
||||
|
||||
seen.setdefault(id_at[move.from_square], []).append(move.from_square)
|
||||
advance_ids(board, move, piece, id_at)
|
||||
|
||||
Reference in new issue
Block a user