Giter Site home page Giter Site logo

tetrisai's Introduction

TetrisAI

Tetris AI using DoubleDQN-CNN

The environment is a version of Tetris where 6 moves are possible:

  • Do nothing
  • Move left
  • Move right
  • Rotate
  • Rotate reverse
  • Drop the piece

Input has a shape of (8,20,10). Each tile is encoded along the depth of 4 depending on whether its a part of the current piece, ground piece, shadow or if it's empty or not. Shadow is a projection of the current piece to the ground. The last 2 timesteps are stacked together to have some kind of a motion info.

Here is a summary of the model



                                      ----- Input --
                                    /         |      \
                                   V          |       \
            Conv2d(8, 16, 5, padding=2)       |        \
                        |                     |         \
                        V                     |          \
            Conv2d(16, 24, 3, padding=1)      |           \  
                        |                     V            V
                        V
    NextPieceInfo - MaxPool2d(2) - Conv2d(8, 8, (20,1)) - Conv2d(8, 8, (1,10)) 
        
                    Concatenation
                        |
                        V
                Linear(1447, 256)
                Linear(256, 6) -> Actions

Gameplay after 11 hours of training on 1050ti. (Includes 4 line clear)

alt text

tetrisai's People

Contributors

cihatceliker avatar

Stargazers

Ahmetcan ÖZCAN avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.