{"id":41285513,"url":"https://github.com/waybarrios/meetup_pythonbq_deeplearning","last_synced_at":"2026-01-23T03:03:59.025Z","repository":{"id":182363088,"uuid":"89732641","full_name":"waybarrios/meetup_pythonbq_deeplearning","owner":"waybarrios","description":"DQN examples","archived":false,"fork":false,"pushed_at":"2020-06-09T17:03:06.000Z","size":72379,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2023-07-20T18:24:57.285Z","etag":null,"topics":["deep-learning","meetup","python","reinforcement-learning","tensorflow"],"latest_commit_sha":null,"homepage":null,"language":"OpenEdge ABL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/waybarrios.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-04-28T18:11:36.000Z","updated_at":"2020-08-01T14:49:33.000Z","dependencies_parsed_at":"2023-07-19T18:34:58.421Z","dependency_job_id":null,"html_url":"https://github.com/waybarrios/meetup_pythonbq_deeplearning","commit_stats":null,"previous_names":["waybarrios/meetup_pythonbq_deeplearning"],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/waybarrios/meetup_pythonbq_deeplearning","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waybarrios%2Fmeetup_pythonbq_deeplearning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waybarrios%2Fmeetup_pythonbq_deeplearning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waybarrios%2Fmeetup_pythonbq_deeplearning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waybarrios%2Fmeetup_pythonbq_deeplearning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/waybarrios","download_url":"https://codeload.github.com/waybarrios/meetup_pythonbq_deeplearning/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waybarrios%2Fmeetup_pythonbq_deeplearning/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28679141,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T01:00:35.747Z","status":"online","status_checked_at":"2026-01-23T02:00:08.296Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","meetup","python","reinforcement-learning","tensorflow"],"created_at":"2026-01-23T03:03:10.070Z","updated_at":"2026-01-23T03:03:59.006Z","avatar_url":"https://github.com/waybarrios.png","language":"OpenEdge ABL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Meetup Barranquilla: Reinforcement learning\n\nDeep Q-learning agent for replicating DeepMind's results in paper [\"Human-level control through deep reinforcement learning\"](http://www.nature.com/nature/journal/v518/n7540/full/nature14236.html)\n\n\n## Overview\nThis project follows the description of the Deep Q Learning algorithm described in Playing Atari with Deep Reinforcement Learning [2] and shows that this learning algorithm can be further generalized to the notorious Flappy Bird, Pong and Space Invaders.\n\n## Installation\n1) Install Tensorflow: \n`pip install tensorflow` \nIf you have NVIDIA GPU, you should do:\n`pip install tensorflow-gpu`\n2) Install pygame:\n`pip install pygame`\n3) Install opencv:\n`pip install opencv-python`\n4) Install all gym dependencies:\n`pip install gym'[all]'`\n\n**Another way:**\n`pip install -r requirements.txt`\n\n\n## What is Deep Q-Network?\nIt is a convolutional neural network, trained with a variant of Q-learning, whose input is raw pixels and whose output is a value function estimating future rewards. For those who are interested in deep reinforcement learning, I highly recommend to read the following post:\n[Demystifying Deep Reinforcement Learning](http://www.nervanasys.com/demystifying-deep-reinforcement-learning/)\n\n\n\n## FlappyBird Architecture \n\nAccording to [1], I first preprocessed the game screens with following steps:\n\n1. Convert image to grayscale\n2. Resize image to 80x80\n3. Stack last 4 frames to produce an 80x80x4 input array for network\n\n**DQN: Network**\n1. First layer convolves the input image with an 8x8x4x32 kernel at a stride size of 4.\n2. The output is then put through a 2x2 max pooling layer. \n3. The second layer convolves with a 4x4x32x64 kernel at a stride of 2. \n4. The third layer convolves with a 3x3x64x64 kernel at a stride of 1.\n5. FullyConnected 1600x512\n6. Readout: FullyConnected 512x2\n\n\n** Training **\nFor training, you should do the following:\n\n  ```\n  cd FlappyBird\n  python deep_q_network.py\n  ```\n## Examples: GYM \nThere are examples developed in OpenAI gym for the pong game and SpaceInvaders.\nJust:\n\n  ```\n  cd atari\n  python pong.py\n  python SpaceInvaders.py \n  ```\n\n## References\n\n[1] Mnih Volodymyr, Koray Kavukcuoglu, David Silver, Andrei A. Rusu, Joel Veness, Marc G. Bellemare, Alex Graves, Martin Riedmiller, Andreas K. Fidjeland, Georg Ostrovski, Stig Petersen, Charles Beattie, Amir Sadik, Ioannis Antonoglou, Helen King, Dharshan Kumaran, Daan Wierstra, Shane Legg, and Demis Hassabis. **Human-level Control through Deep Reinforcement Learning**. Nature, 529-33, 2015.\n\n[2] Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin Riedmiller. **Playing Atari with Deep Reinforcement Learning**. NIPS, Deep Learning workshop\n\n[3] Kevin Chen. **Deep Reinforcement Learning for Flappy Bird** [Report](http://cs229.stanford.edu/proj2015/362_report.pdf) | [Youtube result](https://youtu.be/9WKBzTUsPKc)\n\n## Disclaimer\nThis work is highly based on the following repos:\n\n1. [sourabhv/FlapPyBird](https://github.com/sourabhv/FlapPyBird)\n2. [asrivat1/DeepLearningVideoGames](https://github.com/asrivat1/DeepLearningVideoGames)\n\n## Slides\n[Google Slides] https://docs.google.com/presentation/d/1Oi0C0NpUMlbO1FFujI7rTdc1zeIyGOEEwHLhoC88XYM/edit?usp=sharing\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaybarrios%2Fmeetup_pythonbq_deeplearning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwaybarrios%2Fmeetup_pythonbq_deeplearning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaybarrios%2Fmeetup_pythonbq_deeplearning/lists"}