Deep Learning with TensorFlow - Second Edition
Table of Contents
Deep Learning with TensorFlow - Second Edition
Why subscribe?
PacktPub.com
Contributors
About the authors
About the reviewers
Packt is Searching for Authors Like You
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Get in touch
Reviews
1. Getting Started with Deep Learning
A soft introduction to machine learning
Supervised learning
Unbalanced data
Unsupervised learning
Reinforcement learning
What is deep learning?
Artificial neural networks
The biological neurons
The artificial neuron
How does an ANN learn?
ANNs and the backpropagation algorithm
Weight optimization
Stochastic gradient descent
Neural network architectures
Deep Neural Networks (DNNs)
Multilayer perceptron
Deep Belief Networks (DBNs)
Convolutional Neural Networks (CNNs)
AutoEncoders
Recurrent Neural Networks (RNNs)
Emergent architectures
Deep learning frameworks
Summary
2. A First Look at TensorFlow
A general overview of TensorFlow
What's new from TensorFlow v1.6 forwards?
Nvidia GPU support optimized
Introducing TensorFlow Lite
Eager execution
Optimized Accelerated Linear Algebra (XLA)
Installing and configuring TensorFlow
TensorFlow computational graph
TensorFlow code structure
Eager execution with TensorFlow
Data model in TensorFlow
Tensor
Rank and shape
Data type
Variables
Fetches
Feeds and placeholders
Visualizing computations through TensorBoard
How does TensorBoard work?
Linear regression and beyond
Linear regression revisited for a real dataset
Summary
3. Feed-Forward Neural Networks with TensorFlow
Feed-forward neural networks (FFNNs)
Feed-forward and backpropagation
Weights and biases
Activation functions
Using sigmoid
Using tanh
Using ReLU
Using softmax
Implementing a feed-forward neural network
Exploring the MNIST dataset
Softmax classifier
Implementing a multilayer perceptron (MLP)
Training an MLP
Using MLPs
Dataset description
Preprocessing
A TensorFlow implementation of MLP for client-subscription assessment
Deep Belief Networks (DBNs)
Restricted Boltzmann Machines (RBMs)
Construction of a simple DBN
Unsupervised pre-training
Supervised fine-tuning
Implementing a DBN with TensorFlow for client-subscription assessment
Tuning hyperparameters and advanced FFNNs
Tuning FFNN hyperparameters
Number of hidden layers
Number of neurons per hidden layer
Weight and biases initialization
Selecting the most suitable optimizer
GridSearch and randomized search for hyperparameters tuning
Regularization
Dropout optimization
Summary
4. Convolutional Neural Networks
Main concepts of CNNs
CNNs in action
LeNet5
Implementing a LeNet-5 step by step
AlexNet
Transfer learning
Pretrained AlexNet
Dataset preparation
Fine-tuning implementation
VGG
Artistic style learning with VGG-19
Input images
Content extractor and loss
Style extractor and loss
Merger and total loss
Training
Inception-v3
Exploring Inception with TensorFlow
Emotion recognition with CNNs
Testing the model on your own image
Source code
Summary
5. Optimizing TensorFlow Autoencoders
How does an autoencoder work?
Implementing autoencoders with TensorFlow
Improving autoencoder robustness
Implementing a denoising autoencoder
Implementing a convolutional autoencoder
Encoder
Decoder
Fraud analytics with autoencoders
Description of the dataset
Problem description
Exploratory data analysis
Training, validation, and testing set preparation
Normalization
Autoencoder as an unsupervised feature learning algorithm
Evaluating the model
Summary
6. Recurrent Neural Networks
Working principles of RNNs
Implementing basic RNNs in TensorFlow
RNN and the long-term dependency problem
Bi-directional RNNs
RNN and the gradient vanishing-exploding problem
LSTM networks
GRU cell
Implementing an RNN for spam prediction
Data description and preprocessing
Developing a predictive model for time series data
Description of the dataset
Pre-processing and exploratory analysis
LSTM predictive model
Model evaluation
An LSTM predictive model for sentiment analysis
Network design
LSTM model training
Visualizing through TensorBoard
LSTM model evaluation
Human activity recognition using LSTM model
Dataset description
Workflow of the LSTM model for HAR
Implementing an LSTM model for HAR
Summary
7. Heterogeneous and Distributed Computing
GPGPU computing
The GPGPU history
The CUDA architecture
The GPU programming model
The TensorFlow GPU setup
Update TensorFlow
GPU representation
Using a GPU
GPU memory management
Assigning a single GPU on a multi-GPU system
The source code for GPU with soft placement
Using multiple GPUs
Distributed computing
Model parallelism
Data parallelism
The distributed TensorFlow setup
Summary
8. Advanced TensorFlow Programming
tf.estimator
Estimators
Graph actions
Parsing resources
Flower predictions
TFLearn
Installation
Titanic survival predictor
PrettyTensor
Chaining layers
Normal mode
Sequential mode
Branch and join
Digit classifier
Keras
Keras programming models
Sequential model
Sentiment classification of movie reviews
Functional API
SqueezeNet
Summary
9. Recommendation Systems Using Factorization Machines
Recommendation systems
Collaborative filtering approaches
Content-based filtering approaches
Hybrid recommender systems
Model-based collaborative filtering
Movie recommendation using collaborative filtering
The utility matrix
Description of the dataset
Ratings data
Movies data
Users data
Exploratory analysis of the MovieLens dataset
Implementing a movie RE
Training the model with the available ratings
Inferencing the saved model
Generating the user-item table
Clustering similar movies
Movie rating prediction by users
Finding top k movies
Predicting top k similar movies
Computing user-user similarity
Evaluating the recommender system
Factorization machines for recommendation...