Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.5%) to scientific vocabulary
Last synced: 8 months ago · JSON representation ·

Repository

Basic Info
  • Host: GitHub
  • Owner: mariolpantunes
  • License: mit
  • Language: Python
  • Default Branch: main
  • Size: 44.9 MB
Statistics
  • Stars: 4
  • Watchers: 2
  • Forks: 1
  • Open Issues: 0
  • Releases: 0
Created over 3 years ago · Last pushed over 1 year ago
Metadata Files
Readme License Citation

README.md

Learn to fly using neural evolution

In this work, we will learn to fly using neural evolution. That means teaching a neural network to play a simplified version of the well-known flappy bird. Given the nature of the game itself, it is not easy to train a neural network in a conventional way (using a curated dataset, and a guided optimization based on the gradient). We will instead on different methods that explore the usage of reinforcement learning and genetic optimization to train consecutive improved versions of our model.

The slide for the project can be found here.

Arquitecture

The game is manage by a backend process, the web pages only draw the world, show training data and implement the user input. There are two other processes: train and play. The train process can be used to train a neural network to play the game using population based optimization. The play process loads a neural network and plays the game. There are a webpage dedicated for each phase.

The arquitecture can be found on the following image:

arquitecture

The training should look something like this:

training

And the fully trained agent should look like this:

playing

Usage

Setup

bash git clone https://github.com/mariolpantunes/flappy-bird.git cd flappy-bird python3 -m venv venv source venv/bin/activate pip install -r requirements.txt

Backend

In a terminal run:

bash source venv/bin/activate python -m src.backend [--pipes] -n <number_of_players> -l <limit>

Training

In a terminal run:

bash source venv/bin/activate python -m src.train -n <number_of_players> -e <number_of_epochs> -a [ga|gwo|egwo|de|pso]

Playing

In a terminal run:

bash source venv/bin/activate python -m src.play -l <model.json>

Documentation

This library was documented using the google style docstring, it can be accessed here. Run the following commands to produce the documentation for this library.

bash pdoc --math -d google -o docs src

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details

Owner

  • Name: Mário Antunes
  • Login: mariolpantunes
  • Kind: user
  • Location: Aveiro
  • Company: @ATNoG

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: flappy-bird
message: Learn to fly using neural evolution
type: software
authors:
  - given-names: Mário
    family-names: Antunes
    email: mario.antunes@av.it.pt
    affiliation: IT
    orcid: 'https://orcid.org/0000-0002-6504-9441'

GitHub Events

Total
  • Push event: 1
Last Year
  • Push event: 1

Committers

Last synced: 11 months ago

All Time
  • Total Commits: 45
  • Total Committers: 1
  • Avg Commits per committer: 45.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 1
  • Committers: 1
  • Avg Commits per committer: 1.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Mario Antunes m****s@g****m 45

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Dependencies

requirements.txt pypi
  • numpy >=1.23.4
  • optimization main
  • websockets >=10.4