Amazing-Python-Scripts
..
/
FlappyBird
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
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:
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:
After training the model is saved by name "flappybrain.h5" shown in this repository.
Requirements:
- flappy-bird-gym
- numpy
- tensorflow