Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Hands-On Convolutional Neural Networks with TensorFlow

You're reading from   Hands-On Convolutional Neural Networks with TensorFlow Solve computer vision problems with modeling in TensorFlow and Python

Arrow left icon
Product type Paperback
Published in Aug 2018
Publisher Packt
ISBN-13 9781789130331
Length 272 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (5):
Arrow left icon
Richard Burton Richard Burton
Author Profile Icon Richard Burton
Richard Burton
Giounona Tzanidou Giounona Tzanidou
Author Profile Icon Giounona Tzanidou
Giounona Tzanidou
Iffat Zafar Iffat Zafar
Author Profile Icon Iffat Zafar
Iffat Zafar
Leonardo Araujo Leonardo Araujo
Author Profile Icon Leonardo Araujo
Leonardo Araujo
Nimesh Patel Nimesh Patel
Author Profile Icon Nimesh Patel
Nimesh Patel
+1 more Show less
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Setup and Introduction to TensorFlow FREE CHAPTER 2. Deep Learning and Convolutional Neural Networks 3. Image Classification in TensorFlow 4. Object Detection and Segmentation 5. VGG, Inception Modules, Residuals, and MobileNets 6. Autoencoders, Variational Autoencoders, and Generative Adversarial Networks 7. Transfer Learning 8. Machine Learning Best Practices and Troubleshooting 9. Training at Scale 10. References 11. Other Books You May Enjoy

Code Structure best Practice


In previous chapters we encapsulated our tensorflow graph into a class without discussing it any further. This idea itself is already good coding practice. Having a class responsible to build your graph and exposing only things that are useful for using the model (that is, it’s inputs/outputs) is a good programming practice that will save you lots of time.

Singleton Pattern

It is also common practice to use design patterns in order to solve some software design problems. One of the simplest and most useful design patterns in python is the singleton one. It is used when you want to force the instantiation of a class to only one object, so even if you instantiate this class multiple times in several different places in your project, you will be referencing the same object. In our case if we ask TensorFlow to create multiple nodes or graphs with the same name, it will throw an error. Therefore, we use the singleton pattern while creating the graph to avoid building...

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 $19.99/month. Cancel anytime