You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This project constructs an Opago (오목 모델, Gomoku AI model) AI with the pygame module in Python
A convolutional neural network (CNN) is used
The model structure is very simple and the hyperparameters are already tuned
Model Description
Input : (batchsize, 1, 15, 15) image
Output : (batchsize, 225) array
(The place where the next stone should be placed has value 1, and 0 for others 224 values)
# see how output of the Dataset looks likeprint(torch.reshape(output[0].int(),(15,15)))
Sigmoid function is used only at the last layer to get the biggest value among 255 values
The reason why sigmoid function is used is to make every value to between 0 to 1 and it is ideal that letting the target index's value be close to 1 through training
The index with the biggest value means the place where the next stone should be placed
Output: 255 size array, set value 1 at the place where the next stone is placed after the input image and value 0 for others
We can get a lot of data from just one game
There is tremendous data available on that aforementioned website, which is organized by year
This project itself uses game data from the years 2021, 2020 and 2019
Files Description
pre_dataset
Coordinate information from the website above
Renju is one of the names that refer to a way of playing Gomoku with specific rules (which are also the most popular)
create_dataset.py & dataset
Change coordinate information to numpy 15 * 15 arrays and save them as .npz files in the dataset folder in order to be used as input to the CNN network