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
All 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
Neural Network Programming with TensorFlow

You're reading from   Neural Network Programming with TensorFlow Unleash the power of TensorFlow to train efficient neural networks

Arrow left icon
Product type Paperback
Published in Nov 2017
Publisher Packt
ISBN-13 9781788390392
Length 274 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Rajdeep Dua Rajdeep Dua
Author Profile Icon Rajdeep Dua
Rajdeep Dua
Manpreet Singh Ghotra Manpreet Singh Ghotra
Author Profile Icon Manpreet Singh Ghotra
Manpreet Singh Ghotra
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Title Page
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
1. Maths for Neural Networks FREE CHAPTER 2. Deep Feedforward Networks 3. Optimization for Neural Networks 4. Convolutional Neural Networks 5. Recurrent Neural Networks 6. Generative Models 7. Deep Belief Networking 8. Autoencoders 9. Research in Neural Networks 10. Getting started with TensorFlow

Image classification with convolutional networks


Let's look at a more realistic case for using CNNs; we will use the Stanford Dogs versus Cats dataset. This dataset has 100+ images of dogs and cats.

Note

You can download this dataset (100 images each) from the following location: https://s3.amazonaws.com/neural-networking-book/ch04/dogs_vs_cats.tar.gz

  1. Import the relevant functions and Python classes:
import matplotlib.pyplot as plt
import tensorflow as tf
import pandas as pd
import numpy as np
from sklearn.metrics import confusion_matrix
import time
from datetime import timedelta
import math
import dataset
import random
  1. We will define the parameters for the convolution layers. There are three convolution layers with the following parameters:

Layer number

Layer type

Number of filters/neurons

1

Convolution

32 filters

2

Convolution

32 filters

3

Convolution

64 filters

4

Fully connected

128 neurons

The Network topolgy can be represented as shown in the following diagram:

The following code should be helpful for understanding...

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 AU $19.99/month. Cancel anytime
Visually different images