Search icon CANCEL
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Go Machine Learning Projects

You're reading from  Go Machine Learning Projects

Product type Book
Published in Nov 2018
Publisher Packt
ISBN-13 9781788993401
Pages 348 pages
Edition 1st Edition
Languages
Author (1):
Xuanyi Chew Xuanyi Chew
Profile icon Xuanyi Chew

Table of Contents (12) Chapters

Preface 1. How to Solve All Machine Learning Problems 2. Linear Regression - House Price Prediction 3. Classification - Spam Email Detection 4. Decomposing CO2 Trends Using Time Series Analysis 5. Clean Up Your Personal Twitter Timeline by Clustering Tweets 6. Neural Networks - MNIST Handwriting Recognition 7. Convolutional Neural Networks - MNIST Handwriting Recognition 8. Basic Facial Detection 9. Hot Dog or Not Hot Dog - Using External Services 10. What's Next? 11. Other Books You May Enjoy

Describing a CNN

Having said all that, the neural network is very easy to build. First, we define a neural network as such:

type convnet struct {
g *gorgonia.ExprGraph
w0, w1, w2, w3, w4 *gorgonia.Node // weights. the number at the back indicates which layer it's used for
d0, d1, d2, d3 float64 // dropout probabilities

out *gorgonia.Node
outVal gorgonia.Value
}

Here, we defined a neural network with four layers. A convnet layer is similar to a linear layer in many ways. It can, for example, be written as an equation:

Note that in this specific example, I consider dropout and max-pool to be part of the same layer. In many literatures, they are considered to be separate layers.

I personally do not see the necessity to consider them as separate layers. After all, everything is just a mathematical equation; composing functions comes...

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