-
game2048/
: the main package.game.py
: the core 2048Game
class.agents.py
: theAgent
class with instances, is a strong agent based on rule.displays.py
: theDisplay
class with instances, to show theGame
state.expectimax/
: a powerful ExpectiMax agent by here
- 'model1/': training code for model1 (online)
- 'dataloader.py': dataloader for my model1
- 'models.py: my Neural Network Model based on Vgg
- 'vgg.py: vgg model
- 'utils.py': a tool for batchsize
- 'train.py: my code of online imitation training
- 'model2/': training code for model2
- 'model.py': my Neural Network based on CNN
- 'train.py': my code of CNN training
- 'model3/': training code for model3 & model4
- 'CNN_4096.py': include Network Model and training code for model3 & model4
- 'model5/': training code for model5
- 'CNN_deep.py': include Network Model and training code for model5
- 'agent_voting.py': my design agent, load five models and voting to get direction
- 'model1_pretrain_params.pkl': pre-train model for model1
- 'model2_pretrain_params.pkl': pre-train model for model2
- 'model3_pretrain_params.pkl': pre-train model for model3
- 'model3_pretrain_params_2.pkl': pre-train model for model4
- 'model5_pretrain_params.pkl': pre-train model for model5
- For privacy and github limitation, model5 params haven't been uploaded.
-
explore.ipynb
: introduce how to use theAgent
,Display
andGame
. -
static/
: frontend assets (based on Vue.js) for web app. -
webapp.py
: run the web app (backend) demo. -
evaluate.py
: evaluate your self-defined agent. -
evaluate_voting.py
: evaluate my voting agent.
- code only tested on linux system (ubuntu 16.04)
- Python 3 (Anaconda 3.6.3 specifically) with numpy and flask
- Pytorch 0.4.0
- numpy 1.14.5
cd game2048/expectimax
bash configure
make
python webapp.py
The code is under Apache-2.0 License.
Please read here.