Preface p. xiii
Acknowledgments p. xv
About this book p. xvii
About the author p. xix
About the cover p. xx
Part 1 Your Machine-Learning Rig p. 1
1 A machine-learning odyssey p. 3
1.1 Machine-learning fundamentals p. 5
Parameters p. 7
Learning and inference p. 8
1.2 Data representation and features p. 9
1.3 Distance metrics p. 15
1.4 Types of learning p. 17
Supervised learning p. 17
Unsupervised learning p. 19
Reinforcement learning p. 19
1.5 TensorFlow p. 21
1.6 Overview of future chapters p. 22
1.7 Summary p. 24
2 TensorFlow essentials p. 25
2.1 Ensuring that TensorFlow works p. 27
2.2 Representing tensors p. 28
2.3 Creating operators p. 32
2.4 Executing operators with sessions p. 34
Understanding code as a graph p. 35
Setting session configurations p. 36
2.5 Writing code in Jupyter p. 38
2.6 Using variables p. 41
2.7 Saving and loading variables p. 43
2.8 Visualizing data using TensorBoard p. 44
Implementing a moving average p. 44
Visualizing the moving average p. 46
2.9 Summary p. 49
Part 2 Core Learning Algorithms p. 51
3 Linear regression and beyond p. 53
3.1 Formal notation p. 54
How do you know the regression algorithm is working? p. 57
3.2 Linear regression p. 59
3.3 Polynomial model p. 62
3.4 Regularization p. 65
3.5 Application of linear regression p. 69
3.6 Summary p. 70
4 A gentle introduction to classification p. 71
4.1 Formal notation p. 73
4.2 Measuring performance p. 75
Accuracy p. 75
Precision and recall p. 76
Receiver operating characteristic curve p. 77
4.3 Using linear regression for classification p. 78
4.4 Using logistic regression p. 83
Solving one-dimensional logistic regression p. 84
Solving two-dimensioned logistic regression p. 87
4.5 Multiclass classifier p. 90
One-versus-all p. 91
One-versus-one p. 92
Softmax regression p. 92
4.6 Application of classification p. 96
4.7 Summary p. 97
5 Automatically clustering data p. 99
5.1 Traversing files in TensorFlow p. 100
5.2 Extracting features from audio p. 102
5.3 K-means clustering p. 106
5.4 Audio segmentation p. 109
5.5 Clustering using a sell-organizing map p. 112
5.6 Application of clustering p. 117
5.7 Summary p. 117
6 Hidden Markov models p. 119
6.1 Example of a not-so-interpretable model p. 121
6.2 Markov model p. 121
6.3 Hidden Markov model p. 124
6.4 Forward algorithm p. 125
6.5 Viterbi decoding p. 128
6.6 Uses of hidden Markov models p. 130
Modeling a video p. 130
Modeling DNA p. 130
Madding an image p. 130
6.7 Application of hidden Markov models p. 130
6.8 Summary p. 131
Part 3 Te Neural Network Paradigm p. 133
7 A peek into autoencoders p. 135
7.1 Neural networks p. 136
7.2 Autoencoders p. 140
7.3 Batch training p. 145
7.4 Working with images p. 146
7.5 Application of autoencoders p. 150
7.6 Summary p. 151
8 Reinforcement learning p. 153
8.1 Formal notions p. 155
Policy p. 156
Utility p. 157
8.2 Applying reinforcement learning p. 158
8.3 Implementing reinforcement learning p. 160
8.4 Exploring other applications of reinforcement learning p. 167
8.5 Summary p. 168
9 Convolutional neural networks p. 169
9.1 Drawback of neural networks p. 170
9.2 Convolutional neural networks p. 171
9.3 Preparing the image p. 173
Generating filters p. 176
Convolving using filters p. 178
Max pooling p. 181
9.4 Implementing a convolutional neural network in TensorFlow p. 182
Measuring performance p. 185
Training the classifier p. 186
9.5 Tips and tricks to improve performance p. 187
9.6 Application of convolutional neural networks p. 188
9.7 Summary p. 188
10 Recurrent neural networks p. 189
10.1 Contextual information p. 190
10.2 Introduction to recurrent neural networks p. 190
10.3 Implementing a recurrent neural network p. 192
10.4 A predictive model for time-series data p. 195
10.5 Application of recurrent neural networks p. 198
10.6 Summary p. 199
11 Sequence-to-sequence models for chatbots p. 201
11.1 Building on classification and RNNs p. 202
11.2 Seq2seq architecture p. 205
11.3 Vector representation of symbols p. 210
11.4 Putting it all together p. 212
11.5 Gathering dialogue data p. 220
11.6 Summary p. 222
12 Utility landscape p. 223
12.1 Preference model p. 226
12.2 Image embedding p. 231
12.3 Ranking images p. 234
12.4 Summary p. 239
12.5 What''s next? p. 239
Appendix Installation p. 241
Index p. 247