alpha-zero-general | A clean implementation based on AlphaZero for any game | Machine Learning library

 by   suragnair Jupyter Notebook Version: Current License: MIT

kandi X-RAY | alpha-zero-general Summary

kandi X-RAY | alpha-zero-general Summary

alpha-zero-general is a Jupyter Notebook library typically used in Institutions, Learning, Education, Artificial Intelligence, Machine Learning, Deep Learning, Pytorch, Tensorflow, Keras applications. alpha-zero-general has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

A simplified, highly flexible, commented and (hopefully) easy to understand implementation of self-play based reinforcement learning based on the AlphaGo Zero paper (Silver et al). It is designed to be easy to adopt for any two-player turn-based adversarial game and any deep learning framework of your choice. A sample implementation has been provided for the game of Othello in PyTorch, Keras, TensorFlow and Chainer. An accompanying tutorial can be found here. We also have implementations for GoBang and TicTacToe. To use a game of your choice, subclass the classes in Game.py and NeuralNet.py and implement their functions. Example implementations for Othello can be found in othello/OthelloGame.py and othello/{pytorch,keras,tensorflow,chainer}/NNet.py. Coach.py contains the core training loop and MCTS.py performs the Monte Carlo Tree Search. The parameters for the self-play can be specified in main.py. Additional neural network parameters are in othello/{pytorch,keras,tensorflow,chainer}/NNet.py (cuda flag, batch size, epochs, learning rate etc.).
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              alpha-zero-general has a medium active ecosystem.
              It has 3279 star(s) with 923 fork(s). There are 107 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 41 open issues and 134 have been closed. On average issues are closed in 33 days. There are 24 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of alpha-zero-general is current.

            kandi-Quality Quality

              alpha-zero-general has no bugs reported.

            kandi-Security Security

              alpha-zero-general has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              alpha-zero-general is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              alpha-zero-general releases are not available. You will need to build from source code and install.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed alpha-zero-general and discovered the below as its top functions. This is intended to give you an instant insight into alpha-zero-general implemented functionality, and help decide if they suit your requirements.
            • Train the model
            • Execute the episode
            • Calculates the probability of the given canonical board
            • Play game
            • Play num games
            • Returns if game ended
            • Calculate the score of a board
            • Returns the combined score for a player
            • Get the health score for a player
            • Check if game ended
            • Compute the probability of the given canonical board
            • Calculate the score of a player
            • Play the board
            • Load train examples
            • Encode multiple boards
            • Returns the valid moves for the player
            • Get the next state of the player
            • Get the valid moves
            • Returns 0 if game ended
            • Predict action
            • Determine if the game ended
            • Determine if the player ended
            • Gets the next state in the board
            • Get all symmetries for a board
            • Get the next state of a board
            • Play a board
            • Called when a json input is received
            Get all kandi verified functions for this library.

            alpha-zero-general Key Features

            No Key Features are available at this moment for alpha-zero-general.

            alpha-zero-general Examples and Code Snippets

            No Code Snippets are available at this moment for alpha-zero-general.

            Community Discussions

            Trending Discussions on alpha-zero-general

            QUESTION

            var = (shape) (tensor)?
            Asked 2019-Jul-27 at 11:16

            I am currently trying to grasp Surag Nair's work regarding neural networks.

            In (https://github.com/suragnair/alpha-zero-general/blob/master/othello/keras/OthelloNNet.py) There is this line of code:

            ...

            ANSWER

            Answered 2019-Jul-27 at 11:05

            You have a misconception, Reshape is a layer that performs the reshaping operation, it does not "return a shape". It takes a symbolic input tensor and returns the reshaped tensor, given the shape in the constructor.

            The problem in our code is that the shapes are not right, a shape is a tuple with integers, it seems your tuple contains another tuple inside, and that is not supported. This code works fine as an example:

            Source https://stackoverflow.com/questions/57231204

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install alpha-zero-general

            For easy environment setup, we can use nvidia-docker. Once you have nvidia-docker set up, we can then simply run:.

            Support

            While the current code is fairly functional, we could benefit from the following contributions:.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/suragnair/alpha-zero-general.git

          • CLI

            gh repo clone suragnair/alpha-zero-general

          • sshUrl

            git@github.com:suragnair/alpha-zero-general.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link