Reader small image

You're reading from  Hands-On Deep Learning with TensorFlow

Product typeBook
Published inJul 2017
Reading LevelBeginner
PublisherPackt
ISBN-139781787282773
Edition1st Edition
Languages
Right arrow
Author (1)
Dan Van Boxel
Dan Van Boxel
author image
Dan Van Boxel

Dan Van Boxel is a data scientist and machine learning engineer with over 10 years of experience. He is most well-known for Dan Does Data, a YouTube livestream demonstrating the power and pitfalls of neural networks. He has developed and applied novel statistical models of machine learning to topics such as accounting for truck traffic on highways, travel time outlier detection, and other areas. Dan has also published research articles and presented findings at the Transportation Research Board and other academic journals.
Read more about Dan Van Boxel

Right arrow

Single hidden layer model


Here, we'll put the basics of neural network into practice. We'll adapt the logistic regression TenserFlow code into a single hidden layer of neurons. Then, you'll learn the idea behind backpropagation to compute the weights, that is, train the net. Finally, you'll train your first true neural network in TensorFlow.

The TensorFlow code for this section should look familiar. It's just a slightly evolved version of the logistic regression code. Let's look at how to add a hidden layer of neurons that will compute nonlinear combinations of our input pixels.

You should start with a fresh Python session, execute the code to read in, and set up the data as in the logistic model. It's the same code, just copied to the new file:

import tensorflow as tf
import numpy as np
import math
from tqdm import tqdm
%autoindent
try:
    from tqdm import tqdm
except ImportError:
    def tqdm(x, *args, **kwargs):
        return x

You can always go back to the previous sections and remind...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Hands-On Deep Learning with TensorFlow
Published in: Jul 2017Publisher: PacktISBN-13: 9781787282773

Author (1)

author image
Dan Van Boxel

Dan Van Boxel is a data scientist and machine learning engineer with over 10 years of experience. He is most well-known for Dan Does Data, a YouTube livestream demonstrating the power and pitfalls of neural networks. He has developed and applied novel statistical models of machine learning to topics such as accounting for truck traffic on highways, travel time outlier detection, and other areas. Dan has also published research articles and presented findings at the Transportation Research Board and other academic journals.
Read more about Dan Van Boxel