Skip to content

Use supervised learning (imitation learning) and tree searching approaches to solve the game of 2048.

License

Notifications You must be signed in to change notification settings

voldikss/EE369-2048-AI

Repository files navigation

EE369-2048-AI

For SJTU EE369 final project.

Use supervised learning (imitation learning) and tree searching approaches to solve the game of 2048.

Code structure

To run the evaluation of the agents

  • To evaluate the supervised learning model, run
# Will play the game for 50 times and return the average score
python evaluate.py --agent=cnnagent

P.S. Currently the max score is 1024, the average score is 541.44.

  • To evaluate the tree searching method, run
python evaluate.py --agent=pagent

P.S. With the depth set to 3, the planning method can reach the score 2048.

To run the web app

python webapp.py 

You can also specify an agent by adding --agent. cnnagent, pagent, emagent are usable, RandomAgent by default.

For example, run the web app with the planning agent

python webapp.py --agent=pagent

To compile the pre-defined ExpectiMax agent

cd game2048/expectimax
bash configure
make

demo

LICENSE

The code is under Apache-2.0 License.

About

Use supervised learning (imitation learning) and tree searching approaches to solve the game of 2048.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published