a small neural network model for solving rubik cubes.
try out solving cubes with
cargo run --release -- solve ./model/rubik-512-4x128.bin 500 5(scrambles a cube with 500 random moves and then finds a short solution.)
train it with
cargo run --release -- trainthe model uses a very simple 288 -> 512 -> 128 -> 128 -> 128 -> 128 -> 1 topology with dense layers,
relu activation and residual connections.
it's trained using bellman loss: we minimize the mean square error of
solutions are found using a batched version of the A* search algorithm including a weight argument that controls the balance between following the model's predictions and staying within a reasonable distance from the optimal solution (although I've found that the weight doesn't seem to matter for solution lengths as long as it's at least ~5).
despite the model being so small, it consistently finds solutions using less than 30 moves, with appropriately set weight it doesn't run excessive numbers of A* batches.