Skip to content

Latest commit

 

History

History
22 lines (13 loc) · 1.08 KB

File metadata and controls

22 lines (13 loc) · 1.08 KB

Neural Network Nim game

Cody Smith. 2019

Usage:

Most of the code is in main.js or connections.js . Also, index.html has some user interface code.

From the web

This is written in javascript and can be run from the web page https://m0ose.github.io/cs362_neuralNIM/index.html .

Locally

Download/unzip the files to a directory and then open index.html. You may be able to just double click the index.html file. Otherwise, in chrome go to file->open->[directory]/index.html . Note: I have only tested this in the Chrome browser.

How it works

nim network

This is a hand trained neural network that can play an optimal move in nim. If no optimal move is found then it's output is not defined. It might not even play a valid move at that point.

It required designing a few XOR layers a difference layers and some if-then-else layers out of weighted edges, a tedious but rewarding task.

This uses numeric.js for a matrix representaion and a dot product