github ↗

The second neural layer. Test4 receives Test3's intermediate vectors, reorganizes them, and — checking against a library of legal chess moves — emits a move vector.

Another reversible SOM hierarchy (BaseSOM / MetaSOM / ReversibleSOMHierarchy) with its own Swing visualizer, plus a LegalMoveLibrary that constrains the output to moves that actually exist on the board. Results are written as JSON (org.json).

how it works

It sits one layer above Test3 in the nested architecture: where the first layer organizes what is seen, this one organizes what may be done — pruning the SOM's output to legal chess moves before it leaves as a vector.

compile & run
# build (pulls org.json) mvn compile # run the reversible-SOM visualizer java -cp target/classes test4.ReversableSOMVisualizer
self-organizing maps legal moves json neural java · swing
in progress
01 screenshot
02 screenshot
03 screenshot

…only legal moves replyan illegal one is stalemate before it is ever spoken.

Qxd?the queen would love that capture — but the library says the square is empty. play the move that exists.

=Qa vector that reaches the eighth rank stops being a number and becomes a move.