Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Python Deep Learning

You're reading from  Python Deep Learning

Product type Book
Published in Apr 2017
Publisher Packt
ISBN-13 9781786464453
Pages 406 pages
Edition 1st Edition
Languages
Authors (4):
Valentino Zocca Valentino Zocca
Profile icon Valentino Zocca
Gianmario Spacagna Gianmario Spacagna
Profile icon Gianmario Spacagna
Daniel Slater Daniel Slater
Profile icon Daniel Slater
Peter Roelants Peter Roelants
Profile icon Peter Roelants
View More author details

Table of Contents (18) Chapters

Python Deep Learning
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
Machine Learning – An Introduction Neural Networks Deep Learning Fundamentals Unsupervised Feature Learning Image Recognition Recurrent Neural Networks and Language Models Deep Learning for Board Games Deep Learning for Computer Games Anomaly Detection Building a Production-Ready Intrusion Detection System Index

Q-learning in action


A game may have in the region of 16-60 frames per second, and often rewards will be received based on actions taken many seconds ago. Also, the state space is vast. In computer games, the state contains all the pixels on the screen used as input to the game. If we imagine a screen downsampled to say 80 x 80 pixels, all of which are single color and binary, black or white, that is still a 2^6400 state. This makes a direct map from state to reward impractical.

What we will need to do is learn an approximation of the Q-function. This is where neural networks can be used for their universal function approximation ability. To train our Q-function approximation, we will store all the game states, rewards, and actions our agent took as it plays through the game. The loss function for our network will be the square of the difference between its approximation of the reward in the previous state and the actual reward it got in the current state, plus its approximation of the reward...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}