Giter Site home page Giter Site logo

cs50p_windygrid's Introduction

Wingy Grid

Video Demo: CS50P. Windy Grid

Description: The project is a 7x10 grid turn-based game with an element of stochasticity, where one player is an AI agent and another player is human.

The project implements the following tasks:

  • find an optimal path in grid environment with an element of stochasticity
  • implementation of Expected SARSA algorithm inspired by Theoretical and Empirical Analysis of Expected Sarsa
  • instead of a tabular approach for an Q-value function for educational purposes I decided to choose function approximation by neural network with no hidden layers
  • exposed ability to train own agent by adjusting parameters such as learning rate, number of episodes, ratio for exploration and exploitation
  • modification of Windy Gridworld environment to allow human to play with trained agent
📦project
 ┣ 📜README.md
 ┣ 📜W.pickle
 ┣ 📜main_menu.png
 ┣ 📜players.py
 ┣ 📜project.py
 ┣ 📜requirements.txt
 ┣ 📜test_project.py
 ┗ 📜windy.py

project.py file contains main menu with different options and you can navigate between them

  1. Start a new game
  2. Train an agent. Keep in mind if you want to train a new agent again from scratch it might take some time but you will be able to track this progress.
  3. Game rules
  4. Exit

Moreover, the functions to store and load the pre-trained agent from W.pickle file to be able to play with a human player on a good enough level. Every time you start a game the trained agent will be loaded from this file.

Basic class Player and inherited from it Human and Agent are presented in players.py and implement logic of picking actions, updating state on the grid and weights based on neural network approximation of Q-value calculated by Expected SARSA algorithm.

The windy.py introduces a gridworld environment and exposes a render function to display the grid itself and player positions.

cs50p_windygrid's People

Contributors

terravenil 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.