GithubHelp home page GithubHelp logo

priontu / atari_demonattack_gameplay_with_reinforcement_learning_using_tf_agents Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 20 MB

Implementing Reinforcement Learning to develop an Agent that teaches itself to play the DemonAttack Atari Game. The Agent was developed using tensorflow, TF-Agents and OpenAI Gym Google Cloud Platform.

License: MIT License

Jupyter Notebook 99.94% Python 0.06%
deep-reinforcement-learning google-cloud-platform machine-learning tensorflow tf-agents

atari_demonattack_gameplay_with_reinforcement_learning_using_tf_agents's Introduction

Atari_DemonAttack_Gameplay_with_Reinforcement_Learning_using_TF_Agents (Developed on Google Cloud)

In this project, we implement Reinforcement Learning to develop an Agent that teaches itself to play the DemonAttack Atari Game. The project was developed using tensorflow, TF-Agents and OpenAI Gym.

Reinforcement learning (RL) is the area of machine learning concerned with intelligent agents that take actions in an environment in order to maximize the notion of cumulative reward.

For this project, we use the OpenAI Gym Atari environment, and we train an agent to play efficiently in this environment. The goal is to develop an agent that can exercise Human-Level Control.

The model consists of the following components:

Agent -- The agent is the decision-maker (bot) that interacts with the environment and learns the decisions that maximize the rewards.

Environment -- The environment is the space with which the agent interacts to obtain the rewards.

Observation space -- This is the current state of the environment that the agent observes.

Action space -- This is the decision that the robot takes at each step.

Reward -- In this case, the score of the game, that the agent will try to maximize.

Policy -- A policy defines the learning agent's way of behaving at a given time. It is a mapping from perceived states of the environment to actions to be taken when in those states.

Agent's Gameplay before training (around 10-40 iterations):

myAgentPlays-7

At this point the agent doesn't know much. It's trying different things and learning what works, and which actions lets it earn some rewards.

Agent's Gameplay mid-training (near 150,000 iterations):

myAgentPlays_3

The agent learned some new things -- now it knows it needs to shoot the enemy bats and kill them in order to gain points, but it hasn't yet learned how to stay alive by evading the enemy fire.

Agent's Gameplay after training (over 300,000 iterations):

myAgentPlays_10

At this point in the training, we have reached Human-Level Control in the Gameplay.

We can see that the Gameplay has improved. The agent has learned how to shoot and kill the enemy in order to earn rewards, but it has also learned actions like following enemy movements and evading enemy gunfire which would allow it to earn greater rewards. However, it definitely requries some more training, since the enemy seems to have some more tricks up its sleeve, like increasing speed of movement and gunfire, which the agent hasn't adapted to yet. These would be the same setbacks a human player would face, which he would improve on by playing the game some more. The same applies to our agent.

Google Cloud Machine Configuration: image

References:

[1] https://www.nature.com/articles/nature14236

[2] Hands-On Machine Learning with Scikit-Learn and TensorFlow, by Aurélien Géron

atari_demonattack_gameplay_with_reinforcement_learning_using_tf_agents's People

Contributors

priontu avatar

Watchers

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