modeling-behaviour-of-SoC-players

所属分类:硬件设计
开发工具:Python
文件大小:0KB
下载次数:0
上传日期:2021-07-20 12:57:55
上 传 者sh-1993
说明:  我的毕业论文代码。目标是通过预测玩家在游戏中的下一步动作来模拟玩家的行为,并调查玩家是否...,
(Code for my Diploma Thesis. The goal was to model the players behavior by predicting their next move in a game and investigate whether the addition of their linguistic exchanges would improve the model s predictive accuracy.)

文件列表:
NNarchitecture/ (0, 2021-07-20)
NNarchitecture/GamestatesOHE.py (25549, 2021-07-20)
NNarchitecture/chatsLSTM.py (4804, 2021-07-20)
NNarchitecture/combinedFFLSTM.py (5498, 2021-07-20)
NNarchitecture/combinedLSTMLSTM.py (5582, 2021-07-20)
NNarchitecture/datapreprocessing.py (10328, 2021-07-20)
NNarchitecture/embeddings/ (0, 2021-07-20)
NNarchitecture/gamestatesFF.py (4830, 2021-07-20)
NNarchitecture/gamestatesLSTM.py (4790, 2021-07-20)
NNarchitecture/metrics.py (968, 2021-07-20)
license (1295, 2021-07-20)
listofpackages.txt (10227, 2021-07-20)
requirements.txt (64, 2021-07-20)
soclogsData_NoResources/ (0, 2021-07-20)
soclogsData_NoResources/DevCard.py (2294, 2021-07-20)
soclogsData_NoResources/GameState.py (3920, 2021-07-20)
soclogsData_NoResources/Labels.py (4809, 2021-07-20)
soclogsData_NoResources/Piece.py (1498, 2021-07-20)
soclogsData_NoResources/PlayerState.py (18242, 2021-07-20)
soclogsData_NoResources/collectfeatures.py (38148, 2021-07-20)
soclogsData_NoResources/reduced_logs.py (12955, 2021-07-20)
soclogsData_NoResources/turn.py (9986, 2021-07-20)
thesis-figs/ (0, 2021-07-20)
thesis-figs/Abstract.png (196532, 2021-07-20)
thesis-figs/Archs.PNG (201242, 2021-07-20)
thesis-figs/Combined-archs.png (491715, 2021-07-20)
thesis-figs/Gamestate.png (452839, 2021-07-20)
thesis-figs/Preprocessing.png (238009, 2021-07-20)
thesis-figs/Standalone-archs.png (518556, 2021-07-20)

## Modeling the behaviour of players in *Settlers of Catan* games This repository contains the code implemented during work on my diploma thesis for the Technical University of Crete, department of Electrical and Computer Engineering, titled **Exploiting linguistic data for modeling players’ behaviour instrategic board games**. > The complete [thesis text](https://dias.library.tuc.gr/view/86478?locale=en) is available at the Institutional Repository of TUC ### Thesis Abstract Certain games exhibit social aspects realized often via natural language exchanges. Unfortunately few attempts have been made to take into account both actions and linguistic information for modeling agents. In this thesis the goal is to leverage both types of information in order to create a model that is capable of emulating players' actions taking into account actions performed by all players in the past as well as their previous linguistic exchanges. Recent advances in neural network architectures and more precisely recurrent models allow to sequentially update representations of the game state or linguistic data as well as sharing of parameters between disparate representations. Thus the aim is to use combined representations both for the game state and for the linguistic exchanges in order to model the actions of the players. Data collected in the context of the ERC Advanced Grant project STAC were used for this work. As a first step the raw data were processed to form a Dataset suitable for use in machine learning projects. This step entailed a novel modeling of the way in which information about a game of Settlers of Catan is represented. Then linguistic and gameplay information from the created Dataset was exploited by neural networks to predict the players' actions. Architectures of Feed Forward Neural Networks, Recurrent Neural Networks (such as LSTMs) as well as combined architectures of the two were investigated in the context of this thesis. ![thesis figure](https://github.com/apostolidoum/modeling-behaviour-of-SoC-players/blob/master/thesis-figs/Abstract.png) ### Setting up the environment - Create a new conda environment using `conda create --name --file requirements.txt` - Activate the environment using `conda activate ` ### Creating a SoC dataset ![thesis figure](https://github.com/apostolidoum/modeling-behaviour-of-SoC-players/blob/master/thesis-figs/Gamestate.png) - Transfer the .soclog files in `soclogsData_NoResources` - If you are repeating the process with the same files used in this thesis, unzip `soclogs.zip` in `soclogsData_NoResources` - If you are using new .soclog files make sure you adjust filenames and/or directory names accordingly. (code applicable for .soclog files from jSettlers v.1) - Run `python turn.py` - Run `python reduced_logs.py` - Run `python collectfeatures.py` ![thesis figure](https://github.com/apostolidoum/modeling-behaviour-of-SoC-players/blob/master/thesis-figs/Preprocessing.png) ### Preprocessing the data - In this thesis we used the Glove Embeddings. Download them from [here](http://nlp.stanford.edu/data/glove.6B.zip) and unzip in `NNarchitecture/embeddings/` - Run `python GamestatesOHE.py` - Run `python datapreprocessing.py` ### Train the networks You can now run any of the modules `gamestatesFF.py`, `gamestatesLSTM.py`, `chatsLSTM.py`, `combinedFFLSTM.py`, `combinedLSTMLSTM.py` to train the models. ![thesis figure](https://github.com/apostolidoum/modeling-behaviour-of-SoC-players/blob/master/thesis-figs/Archs.PNG) *NOTE THAT :* This project requires a lot of disk space to run since the networks are deep and the training spans over many epochs. Make sure that you have enough space and that your system does not overheat during the training process. Try testing the training for a small number of epochs or smaller networks before getting deeper to make sure that you do not damage your system. Other than that feel free to tweak any parameters or even try the network configurations tested in this thesis and see what results you get! *DISCLAIMER :* The precision, recall and F1 score have been removed from Keras since version 2.0, because those metrics are global metrics whereas Keras works in batches. As a result they might be more misleading than helpful. It is advised both by the Keras community and the author that they be interpreted with caution. The F1 score is printed when running the training of the models but has not been included in the dissertation due to its unreliability. Enjoy!

近期下载者

相关文件


收藏者