Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Deep Learning with Go

You're reading from   Hands-On Deep Learning with Go A practical guide to building and implementing neural network models using Go

Arrow left icon
Product type Paperback
Published in Aug 2019
Publisher Packt
ISBN-13 9781789340990
Length 242 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Darrell Chua Darrell Chua
Author Profile Icon Darrell Chua
Darrell Chua
Gareth Seneque Gareth Seneque
Author Profile Icon Gareth Seneque
Gareth Seneque
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Preface 1. Section 1: Deep Learning in Go, Neural Networks, and How to Train Them
2. Introduction to Deep Learning in Go FREE CHAPTER 3. What Is a Neural Network and How Do I Train One? 4. Beyond Basic Neural Networks - Autoencoders and RBMs 5. CUDA - GPU-Accelerated Training 6. Section 2: Implementing Deep Neural Network Architectures
7. Next Word Prediction with Recurrent Neural Networks 8. Object Recognition with Convolutional Neural Networks 9. Maze Solving with Deep Q-Networks 10. Generative Models with Variational Autoencoders 11. Section 3: Pipeline, Deployment, and Beyond!
12. Building a Deep Learning Pipeline 13. Scaling Deployment 14. Other Books You May Enjoy

Solving a maze using a DQN in Gorgonia

Now, it's time to build our maze solver!

Using a DQN to solve a little ASCII maze is a bit like bringing a bulldozer to the beach to make sandcastles for your kids: it's completely unnecessary, but you get to play with a big machine. However, as a tool for learning about DQNs, mazes are invaluable. This is because the number of states or actions in the game is limited, and the representation of constraints is also simple (such as the walls of our maze that our agent cannot move through). This means that we can step through our program and easily inspect what our network is doing.

We will follow these steps:

  1. Create a maze.go file for this bit of code
  2. Import our libraries and set our data type
  3. Define our Maze{}
  4. Write a NewMaze() function to instantiate this struct

We also need to define our Maze{} helper functions. These include...

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 €18.99/month. Cancel anytime