Amazing-Python-Scripts

Форк
0

README.md

FlappyBird

This repository contains the implementation of two OpenAI Gym environments for the Flappy Bird game. The implementation of the game's logic and graphics was based on the FlapPyBird project.

In this flappy.py file I train the Neural Network model with reinforcement learning approach.

Performance of trained Agent

https://user-images.githubusercontent.com/51924622/121337387-1dca1080-c93a-11eb-9b9f-61bf00bc327f.mp4


To check the performance and visualize the agent uncomment the agent.perform() and comment the agent.train() in the flappy.py file.
if __name__ == '__main__':
  agent = DQNAgent()
  #agent.train()
  agent.perform()

Perform Function:

Capture1

Train the Agent

For train the agent uncomment the agent.train() in the .py file.
if name == 'main':
  agent = DQNAgent()
  agent.train()
  #agent.perform()

Train Function:

Capture

After training the model is saved by name "flappybrain.h5" shown in this repository.

Requirements:

  • flappy-bird-gym
  • numpy
  • tensorflow

Fork and Run the flappy.py file to see the result.

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.