100% found this document useful (1 vote)
25 views

Pro Deep Learning With Tensorflow 2.0: A Mathematical Approach To Advanced Artificial Intelligence in Python 2Nd Edition Santanu Pattanayak

ebook

Uploaded by

khiyarlmi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
25 views

Pro Deep Learning With Tensorflow 2.0: A Mathematical Approach To Advanced Artificial Intelligence in Python 2Nd Edition Santanu Pattanayak

ebook

Uploaded by

khiyarlmi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 49

Full download ebook at ebookmeta.

com

Pro Deep Learning with TensorFlow 2.0: A


Mathematical Approach to Advanced Artificial
Intelligence in Python 2nd Edition Santanu
Pattanayak
https://ebookmeta.com/product/pro-deep-learning-
with-tensorflow-2-0-a-mathematical-approach-to-
advanced-artificial-intelligence-in-python-2nd-
edition-santanu-pattanayak/

Download more ebook from https://ebookmeta.com


More products digital (pdf, epub, mobi) instant
download maybe you interests ...

Applied Deep Learning with TensorFlow 2: Learn to


Implement Advanced Deep Learning Techniques with
Python, 2nd Edition Umberto Michelucci

https://ebookmeta.com/product/applied-deep-learning-with-
tensorflow-2-learn-to-implement-advanced-deep-learning-
techniques-with-python-2nd-edition-umberto-michelucci-2/

Applied Deep Learning with TensorFlow 2: Learn to


Implement Advanced Deep Learning Techniques with Python
2nd Edition Umberto Michelucci

https://ebookmeta.com/product/applied-deep-learning-with-
tensorflow-2-learn-to-implement-advanced-deep-learning-
techniques-with-python-2nd-edition-umberto-michelucci/

Learn TensorFlow 2.0: Implement Machine Learning and


Deep Learning Models with Python 1st Edition Pramod
Singh

https://ebookmeta.com/product/learn-tensorflow-2-0-implement-
machine-learning-and-deep-learning-models-with-python-1st-
edition-pramod-singh/

Quantum Machine Learning With Python Using Cirq from


Google Research and IBM Qiskit 1st Edition Santanu
Pattanayak

https://ebookmeta.com/product/quantum-machine-learning-with-
python-using-cirq-from-google-research-and-ibm-qiskit-1st-
edition-santanu-pattanayak/
Deep Reinforcement Learning with Python: With PyTorch,
TensorFlow and OpenAI Gym 1st Edition Nimish Sanghi

https://ebookmeta.com/product/deep-reinforcement-learning-with-
python-with-pytorch-tensorflow-and-openai-gym-1st-edition-nimish-
sanghi-3/

Deep Reinforcement Learning with Python With PyTorch


TensorFlow and OpenAI Gym 1st Edition Nimish Sanghi

https://ebookmeta.com/product/deep-reinforcement-learning-with-
python-with-pytorch-tensorflow-and-openai-gym-1st-edition-nimish-
sanghi/

Deep Reinforcement Learning with Python With PyTorch


TensorFlow and OpenAI Gym 1st Edition Nimish Sanghi

https://ebookmeta.com/product/deep-reinforcement-learning-with-
python-with-pytorch-tensorflow-and-openai-gym-1st-edition-nimish-
sanghi-2/

Deep Learning with Python 2nd Edition Nikhil Ketkar

https://ebookmeta.com/product/deep-learning-with-python-2nd-
edition-nikhil-ketkar/

Deep Learning with Swift for TensorFlow Rahul Bhalley

https://ebookmeta.com/product/deep-learning-with-swift-for-
tensorflow-rahul-bhalley/
Pro Deep
Learning with
TensorFlow 2.0
A Mathematical Approach to Advanced
Artificial Intelligence in Python

Second Edition

Santanu Pattanayak
Pro Deep Learning with
TensorFlow 2.0
A Mathematical Approach to
Advanced Artificial Intelligence
in Python
Second Edition

Santanu Pattanayak
Pro Deep Learning with TensorFlow 2.0: A Mathematical Approach to Advanced
Artificial Intelligence in Python
Santanu Pattanayak
Prestige Ozone
Bangalore, Karnataka, India

ISBN-13 (pbk): 978-1-4842-8930-3 ISBN-13 (electronic): 978-1-4842-8931-0


https://doi.org/10.1007/978-1-4842-8931-0
Copyright © 2023 by Santanu Pattanayak
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the
material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information
storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now
known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with
every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an
editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the
trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not
identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to
proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication,
neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or
omissions that may be made. The publisher makes no warranty, express or implied, with respect to the
material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Celestin Suresh John
Development Editor: Laura Berendson
Coordinating Editor: Aditee Mirashi
Cover designed by eStudioCalamar
Cover image by Pixabay (www.pixabay.com)
Distributed to the book trade worldwide by Apress Media, LLC, 1 New York Plaza, New York, NY 10004,
U.S.A. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail [email protected], or visit www.
springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science
+ Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
For information on translations, please e-mail [email protected]; for reprint,
paperback, or audio rights, please e-mail [email protected].
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and
licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales
web page at http://www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is available to
readers on GitHub (https://github.com/Apress). For more detailed information, please visit http://www.
apress.com/source-code.
Printed on acid-free paper
To my wife, Sonia.
Table of Contents
About the Author��������������������������������������������������������������������������������������������������� xiii

About the Technical Reviewer���������������������������������������������������������������������������������xv

Introduction�����������������������������������������������������������������������������������������������������������xvii

Chapter 1: Mathematical Foundations��������������������������������������������������������������������� 1


Linear Algebra������������������������������������������������������������������������������������������������������������������������������� 2
Vector�������������������������������������������������������������������������������������������������������������������������������������� 3
Scalar�������������������������������������������������������������������������������������������������������������������������������������� 4
Matrix�������������������������������������������������������������������������������������������������������������������������������������� 4
Tensor�������������������������������������������������������������������������������������������������������������������������������������� 5
Matrix Operations and Manipulations�������������������������������������������������������������������������������������� 6
Linear Independence of Vectors�������������������������������������������������������������������������������������������� 10
Rank of a Matrix�������������������������������������������������������������������������������������������������������������������� 12
Identity Matrix or Operator���������������������������������������������������������������������������������������������������� 13
Determinant of a Matrix�������������������������������������������������������������������������������������������������������� 13
Inverse of a Matrix����������������������������������������������������������������������������������������������������������������� 16
Norm of a Vector�������������������������������������������������������������������������������������������������������������������� 17
Pseudo-Inverse of a Matrix��������������������������������������������������������������������������������������������������� 19
Unit Vector in the Direction of a Specific Vector�������������������������������������������������������������������� 19
Projection of a Vector in the Direction of Another Vector������������������������������������������������������� 20
Eigen Vectors������������������������������������������������������������������������������������������������������������������������� 21
Calculus�������������������������������������������������������������������������������������������������������������������������������������� 28
Differentiation������������������������������������������������������������������������������������������������������������������������ 28
Gradient of a Function����������������������������������������������������������������������������������������������������������� 29
Successive Partial Derivatives���������������������������������������������������������������������������������������������� 30

v
Table of Contents

Hessian Matrix of a Function������������������������������������������������������������������������������������������������� 30


Maxima and Minima of Functions����������������������������������������������������������������������������������������� 31
Local Minima and Global Minima������������������������������������������������������������������������������������������ 34
Positive Semi-definite and Positive Definite�������������������������������������������������������������������������� 35
Convex Set����������������������������������������������������������������������������������������������������������������������������� 35
Convex Function�������������������������������������������������������������������������������������������������������������������� 35
Non-convex Function������������������������������������������������������������������������������������������������������������� 36
Multivariate Convex and Non-convex Functions Examples��������������������������������������������������� 36
Taylor Series�������������������������������������������������������������������������������������������������������������������������� 39
Probability����������������������������������������������������������������������������������������������������������������������������������� 40
Unions, Intersection, and Conditional Probability������������������������������������������������������������������ 41
Chain Rule of Probability for Intersection of Event���������������������������������������������������������������� 43
Mutually Exclusive Events����������������������������������������������������������������������������������������������������� 43
Independence of Events�������������������������������������������������������������������������������������������������������� 43
Conditional Independence of Events������������������������������������������������������������������������������������� 44
Bayes Rule����������������������������������������������������������������������������������������������������������������������������� 44
Probability Mass Function����������������������������������������������������������������������������������������������������� 45
Probability Density Function�������������������������������������������������������������������������������������������������� 45
Expectation of a Random Variable����������������������������������������������������������������������������������������� 46
Variance of a Random Variable���������������������������������������������������������������������������������������������� 46
Skewness and Kurtosis��������������������������������������������������������������������������������������������������������� 47
Covariance����������������������������������������������������������������������������������������������������������������������������� 50
Correlation Coefficient����������������������������������������������������������������������������������������������������������� 50
Some Common Probability Distribution��������������������������������������������������������������������������������� 51
Likelihood Function��������������������������������������������������������������������������������������������������������������� 60
Maximum Likelihood Estimate���������������������������������������������������������������������������������������������� 61
Hypothesis Testing and p Value��������������������������������������������������������������������������������������������� 63
Formulation of Machine-Learning Algorithm and Optimization Techniques������������������������������� 66
Supervised Learning�������������������������������������������������������������������������������������������������������������� 67
Unsupervised Learning���������������������������������������������������������������������������������������������������������� 79
Reinforcement Learning�������������������������������������������������������������������������������������������������������� 80

vi
Table of Contents

Optimization Techniques for Machine-Learning Gradient Descent���������������������������������������� 81


Constrained Optimization Problem���������������������������������������������������������������������������������������� 93
A Few Important Topics in Machine Learning����������������������������������������������������������������������������� 96
Dimensionality-Reduction Methods�������������������������������������������������������������������������������������� 96
Regularization��������������������������������������������������������������������������������������������������������������������� 102
Regularization Viewed as a Constraint Optimization Problem��������������������������������������������� 105
Bias and Variance Trade-Off������������������������������������������������������������������������������������������������ 106
Summary���������������������������������������������������������������������������������������������������������������������������������� 108

Chapter 2: Introduction to Deep-­Learning Concepts and TensorFlow������������������ 109


Deep Learning and Its Evolution����������������������������������������������������������������������������������������������� 109
Perceptrons and Perceptron Learning Algorithm���������������������������������������������������������������������� 113
Geometrical Interpretation of Perceptron Learning������������������������������������������������������������� 117
Limitations of Perceptron Learning������������������������������������������������������������������������������������� 118
Need for Nonlinearity����������������������������������������������������������������������������������������������������������� 121
Hidden-Layer Perceptrons’ Activation Function for Nonlinearity����������������������������������������� 123
Different Activation Functions for a Neuron/Perceptron������������������������������������������������������ 124
Learning Rule for Multi-layer Perceptron Network�������������������������������������������������������������� 134
Backpropagation for Gradient Computation������������������������������������������������������������������������ 136
Generalizing the Backpropagation Method for Gradient Computation�������������������������������� 138
TensorFlow�������������������������������������������������������������������������������������������������������������������������������� 146
Common Deep-Learning Packages������������������������������������������������������������������������������������� 147
TensorFlow Installation�������������������������������������������������������������������������������������������������������� 149
TensorFlow Basics for Development����������������������������������������������������������������������������������� 149
Gradient-Descent Optimization Methods from a Deep-­Learning Perspective��������������������� 157
Learning Rate in Mini-Batch Approach to Stochastic Gradient Descent����������������������������� 164
Optimizers in TensorFlow���������������������������������������������������������������������������������������������������� 164
XOR Implementation Using TensorFlow������������������������������������������������������������������������������� 176
Linear Regression in TensorFlow����������������������������������������������������������������������������������������� 184
Multiclass Classification with SoftMax Function Using Full-Batch Gradient Descent��������� 187
Multiclass Classification with SoftMax Function Using Stochastic Gradient Descent��������� 191

vii
Table of Contents

GPU������������������������������������������������������������������������������������������������������������������������������������������� 196
TPU�������������������������������������������������������������������������������������������������������������������������������������������� 196
Summary���������������������������������������������������������������������������������������������������������������������������������� 197

Chapter 3: Convolutional Neural Networks����������������������������������������������������������� 199


Convolution Operation��������������������������������������������������������������������������������������������������������������� 199
Linear Time Invariant (LTI)/Linear Shift Invariant (LSI) Systems������������������������������������������ 200
Convolution for Signals in One Dimension�������������������������������������������������������������������������� 202
Analog and Digital Signals�������������������������������������������������������������������������������������������������������� 205
2D and 3D Signals��������������������������������������������������������������������������������������������������������������� 207
2D Convolution�������������������������������������������������������������������������������������������������������������������������� 209
Two-Dimensional Unit Step Function���������������������������������������������������������������������������������� 209
2D Convolution of a Signal with an LSI System Unit Step Response����������������������������������� 211
2D Convolution of an Image to Different LSI System Responses���������������������������������������� 214
Common Image-Processing Filters������������������������������������������������������������������������������������������� 219
Mean Filter�������������������������������������������������������������������������������������������������������������������������� 220
Median Filter����������������������������������������������������������������������������������������������������������������������� 222
Gaussian Filter��������������������������������������������������������������������������������������������������������������������� 225
Gradient-Based Filters��������������������������������������������������������������������������������������������������������� 226
Sobel Edge-Detection Filter������������������������������������������������������������������������������������������������� 228
Identity Transform���������������������������������������������������������������������������������������������������������������� 231
Convolution Neural Networks��������������������������������������������������������������������������������������������������� 232
Components of Convolution Neural Networks�������������������������������������������������������������������������� 233
Input Layer��������������������������������������������������������������������������������������������������������������������������� 235
Convolution Layer���������������������������������������������������������������������������������������������������������������� 235
Pooling Layer����������������������������������������������������������������������������������������������������������������������� 238
Backpropagation Through the Convolutional Layer������������������������������������������������������������������ 239
Backpropagation Through the Pooling Layers�������������������������������������������������������������������������� 243
Weight Sharing Through Convolution and Its Advantages�������������������������������������������������������� 244
Translation Equivariance����������������������������������������������������������������������������������������������������������� 245
Translation Invariance Due to Pooling��������������������������������������������������������������������������������������� 247

viii
Table of Contents

Dropout Layers and Regularization������������������������������������������������������������������������������������������� 248


Convolutional Neural Network for Digit Recognition on the MNIST Dataset����������������������������� 250
Convolutional Neural Network for Solving Real-World Problems���������������������������������������������� 255
Batch Normalization������������������������������������������������������������������������������������������������������������������ 265
Different Architectures in Convolutional Neural Networks�������������������������������������������������������� 268
LeNet����������������������������������������������������������������������������������������������������������������������������������� 268
AlexNet�������������������������������������������������������������������������������������������������������������������������������� 270
VGG16���������������������������������������������������������������������������������������������������������������������������������� 272
ResNet��������������������������������������������������������������������������������������������������������������������������������� 273
Transfer Learning���������������������������������������������������������������������������������������������������������������������� 274
Guidelines for Using Transfer Learning�������������������������������������������������������������������������������� 276
Transfer Learning with Google’s InceptionV3���������������������������������������������������������������������� 277
Transfer Learning with Pretrained VGG16���������������������������������������������������������������������������� 278
Dilated Convolution������������������������������������������������������������������������������������������������������������������� 284
Depthwise Separable Convolution�������������������������������������������������������������������������������������������� 285
Summary���������������������������������������������������������������������������������������������������������������������������������� 290

Chapter 4: Natural Language Processing������������������������������������������������������������� 293


Vector Space Model (VSM)�������������������������������������������������������������������������������������������������������� 293
Vector Representation of Words������������������������������������������������������������������������������������������������ 298
Word2Vec���������������������������������������������������������������������������������������������������������������������������������� 299
Continuous Bag of Words (CBOW)��������������������������������������������������������������������������������������� 300
Continuous Bag of Words Implementation in TensorFlow��������������������������������������������������� 304
Skip-Gram Model for Word Embedding������������������������������������������������������������������������������� 310
Skip-Gram Implementation in TensorFlow�������������������������������������������������������������������������� 313
Global Co-occurrence Statistics-Based Word Vectors��������������������������������������������������������� 319
GloVe����������������������������������������������������������������������������������������������������������������������������������� 326
Word Analogy with Word Vectors����������������������������������������������������������������������������������������� 330
Introduction to Recurrent Neural Networks������������������������������������������������������������������������������ 334
Language Modeling������������������������������������������������������������������������������������������������������������� 338
Predicting the Next Word in a Sentence Through RNN Versus Traditional Methods������������ 339
Backpropagation Through Time (BPTT)������������������������������������������������������������������������������� 340

ix
Table of Contents

Vanishing- and Exploding-Gradient Problem in RNN����������������������������������������������������������� 344


Solution to Vanishing- and Exploding-Gradient Problem in RNNs��������������������������������������� 347
Long Short-Term Memory (LSTM)��������������������������������������������������������������������������������������� 348
LSTM in Reducing Exploding- and Vanishing-Gradient Problems�������������������������������������� 351
MNIST Digit Identification in TensorFlow Using Recurrent Neural Networks���������������������� 353
Gated Recurrent Unit (GRU)������������������������������������������������������������������������������������������������� 365
Bidirectional RNN���������������������������������������������������������������������������������������������������������������� 368
Architecture of the Neural Machine Translation Model Using Seq2Seq������������������������������ 370
Limitation of the Seq2Seq Model for Machine Translation�������������������������������������������������� 382
Attention����������������������������������������������������������������������������������������������������������������������������������� 383
Scaled Dot Product Attention���������������������������������������������������������������������������������������������������� 384
Multihead Attention������������������������������������������������������������������������������������������������������������������� 387
Transformers����������������������������������������������������������������������������������������������������������������������������� 387
Encoder������������������������������������������������������������������������������������������������������������������������������� 388
Decoder������������������������������������������������������������������������������������������������������������������������������� 389
Positional Encoding������������������������������������������������������������������������������������������������������������� 390
Final Output������������������������������������������������������������������������������������������������������������������������� 390
Summary���������������������������������������������������������������������������������������������������������������������������������� 404

Chapter 5: Unsupervised Learning with Restricted Boltzmann Machines and


Autoencoders������������������������������������������������������������������������������������������������������� 407
Boltzmann Distribution������������������������������������������������������������������������������������������������������������� 408
Bayesian Inference: Likelihood, Priors, and Posterior Probability Distribution�������������������������� 410
Markov Chain Monte Carlo Methods for Sampling�������������������������������������������������������������������� 416
Metropolis Algorithm����������������������������������������������������������������������������������������������������������� 420
Restricted Boltzmann Machines����������������������������������������������������������������������������������������������� 427
Training a Restricted Boltzmann Machine��������������������������������������������������������������������������� 434
Gibbs Sampling������������������������������������������������������������������������������������������������������������������� 440
Block Gibbs Sampling���������������������������������������������������������������������������������������������������������� 442
Burn-in Period and Generating Samples in Gibbs Sampling����������������������������������������������� 442
Using Gibbs Sampling in Restricted Boltzmann Machines�������������������������������������������������� 443
Contrastive Divergence������������������������������������������������������������������������������������������������������� 445

x
Table of Contents

A Restricted Boltzmann Implementation in TensorFlow������������������������������������������������������ 446


Collaborative Filtering Using Restricted Boltzmann Machines�������������������������������������������� 452
Deep-Belief Networks (DBNs)���������������������������������������������������������������������������������������������� 458
Autoencoders���������������������������������������������������������������������������������������������������������������������������� 467
Feature Learning Through Autoencoders for Supervised Learning������������������������������������� 471
Kullback-Leibler (KL) Divergence���������������������������������������������������������������������������������������� 473
Sparse Autoencoder Implementation in TensorFlow����������������������������������������������������������� 477
Denoising Autoencoder�������������������������������������������������������������������������������������������������������� 482
A Denoising Autoencoder Implementation in TensorFlow��������������������������������������������������� 482
Variational Inference����������������������������������������������������������������������������������������������������������� 491
Variational Autoencoder Objective from ELBO��������������������������������������������������������������������� 494
Implementation Details of the Variational Autoencoder������������������������������������������������������ 496
Implementation of Variational Autoencoder������������������������������������������������������������������������� 498
PCA and ZCA Whitening������������������������������������������������������������������������������������������������������������ 505
Summary���������������������������������������������������������������������������������������������������������������������������������� 509

Chapter 6: Advanced Neural Networks����������������������������������������������������������������� 511


Image Segmentation����������������������������������������������������������������������������������������������������������������� 512
Binary Thresholding Method Based on Histogram of Pixel Intensities�������������������������������� 512
Otsu’s Method��������������������������������������������������������������������������������������������������������������������� 513
Watershed Algorithm for Image Segmentation�������������������������������������������������������������������� 518
Image Segmentation Using K-means Clustering����������������������������������������������������������������� 522
Semantic Segmentation������������������������������������������������������������������������������������������������������ 526
Sliding-Window Approach��������������������������������������������������������������������������������������������������� 527
Fully Convolutional Network (FCN)�������������������������������������������������������������������������������������� 528
Fully Convolutional Network with Downsampling and Upsampling������������������������������������ 531
U-Net����������������������������������������������������������������������������������������������������������������������������������� 537
Semantic Segmentation in TensorFlow with Fully Connected Neural Networks����������������� 539
Image Classification and Localization Network������������������������������������������������������������������������ 547
Object Detection������������������������������������������������������������������������������������������������������������������������ 549
R-CNN���������������������������������������������������������������������������������������������������������������������������������� 551
Fast and Faster R-CNN�������������������������������������������������������������������������������������������������������� 553

xi
Table of Contents

Generative Adversarial Networks���������������������������������������������������������������������������������������������� 554


Maximin and Minimax Problem������������������������������������������������������������������������������������������� 556
Zero-Sum Game������������������������������������������������������������������������������������������������������������������ 558
Minimax and Saddle Points������������������������������������������������������������������������������������������������� 560
GAN Cost Function and Training������������������������������������������������������������������������������������������ 562
Vanishing Gradient for the Generator���������������������������������������������������������������������������������� 565
GAN Learning from an F-Divergence Perspective��������������������������������������������������������������� 566
TensorFlow Implementation of a GAN Network������������������������������������������������������������������� 568
CycleGAN Implementation in TensorFlow���������������������������������������������������������������������������� 577
Geometric Deep Learning and Graph Neural Networks������������������������������������������������������������ 589
Manifolds����������������������������������������������������������������������������������������������������������������������������� 590
Implementation of Graph Classification Using GCN������������������������������������������������������������� 620
Summary���������������������������������������������������������������������������������������������������������������������������������� 634

Index��������������������������������������������������������������������������������������������������������������������� 635

xii
About the Author
Santanu Pattanayak works as a Senior Staff Machine
Learning Specialist at Qualcomm Corp R&D and is the
author of Quantum Machine Learning with Python,
published by Apress. He has more than 16 years of
experience, having worked at GE, Capgemini, and IBM
before joining Qualcomm. He graduated with a degree in
electrical engineering from Jadavpur University, Kolkata, and
is an avid math enthusiast. Santanu has a master’s degree in
data science from the Indian Institute of Technology (IIT),
Hyderabad. Currently, he resides in Bangalore with his wife.

xiii
About the Technical Reviewer
Manohar Swamynathan is a data science practitioner and
an avid programmer, with over 14+ years of experience
in various data science–related areas that include data
warehousing, business intelligence (BI), analytical tool
development, ad hoc analysis, predictive modeling, data
science product development, consulting, formulating
strategies, and executing analytics programs. He’s had
a career covering the life cycle of data across different
domains, such as US mortgage banking, retail/ecommerce,
insurance, and industrial IoT. He has a bachelor’s degree
with a specialization in physics, mathematics, and
computers and a master’s degree in project management.
He’s currently living in Bengaluru, the Silicon Valley of India.

xv
Introduction
Pro Deep Learning with TensorFlow 2.0 is a practical and mathematical guide to deep
learning using TensorFlow. Deep learning is a branch of machine learning where
you model the world in terms of a hierarchy of concepts. This pattern of learning is
similar to the way a human brain learns, and it allows computers to model complex
concepts that often go unnoticed in other traditional methods of modeling. Hence, in
the modern computing paradigm, deep learning plays a vital role in modeling complex
real-world problems, especially by leveraging the massive amount of unstructured data
available today.
Because of the complexities involved in a deep-learning model, many times it is
treated as a black box by people using it. However, to derive the maximum benefit from
this branch of machine learning, one needs to uncover the hidden mystery by looking
at the science and mathematics associated with it. In this book, great care has been
taken to explain the concepts and techniques associated with deep learning from a
mathematical as well as a scientific viewpoint. Also, the first chapter is totally dedicated
toward building the mathematical base required to comprehend deep-learning concepts
with ease. TensorFlow has been chosen as the deep-learning package because of
its flexibility for research purposes and its ease of use. Another reason for choosing
TensorFlow is its capability to load models with ease in a live production environment
using its serving capabilities.
In summary, Pro Deep Learning with TensorFlow 2.0 provides practical, hands-on
expertise so you can learn deep learning from scratch and deploy meaningful deep-­
learning solutions. This book will allow you to get up to speed quickly using TensorFlow
and to optimize different deep-learning architectures. All the practical aspects of deep
learning that are relevant in any industry are emphasized in this book. You will be able
to use the prototypes demonstrated to build new deep-learning applications. The code
presented in the book is available in the form of iPython notebooks and scripts that allow
you to try out examples and extend them in interesting ways. You will be equipped with
the mathematical foundation and scientific knowledge to pursue research in this field
and give back to the community.

xvii
Another random document with
no related content on Scribd:
The broth of boiled meat should always be saved to use in soups,
stews, and gravies. Stewing and simmering meats means to place
them near enough to the fire to keep the water on them bubbling
moderately, constantly, and slowly. Salt meats should be put over
the fire in cold water, which as soon as it boils should be replaced by
fresh cold water, the water to be changed until it remains fresh
enough to give the meat a palatable flavor when done. Salted and
smoked meats require about 30 minutes’ very slow boiling, from the
time the water boils, to each pound. Vegetables and herbs may be
boiled with them to flavor them. When they are cooked the vessel
containing them should be set where they will keep hot without
boiling until required, if they are to be served hot; if they are to be
served cold, they should be allowed to cool in the pot liquor in which
they were boiled. Very salt meats, or those much dried in smoking,
should be soaked overnight in cold water before boiling.

Roasting

Wipe meat with damp cloth. Trim and tie into shape if necessary.
In the bottom of pan put some pieces of fat from meat. Arrange
meat on rack in pan. Dredge with salt, pepper, and flour. Have oven
very hot at first; when meat is half done reduce heat. Baste every 10
or 15 minutes. If there is danger of fat in pan being scorched add a
few spoons of boiling water. Allow from 10 to 20 minutes per pound
of meat, according as it is desired rare or well done. When done
remove to hot platter. Thicken gravy in pan with browned flour,
adding more water as necessary and add seasoning.
Yorkshire Pudding.-¾ pint flour, 3 eggs, 1½ pints milk, pinch
salt, 1½ teaspoons Royal Baking Powder. Sift flour and powder
together, add eggs, beaten with milk, stir quickly into rather thinner
batter than for griddle cakes, pour into dripping-pan, plentifully
greased with beef-dripping, bake in hot oven 25 minutes; serve with
roast beef.
Braised Beef.—Wipe and trim 6 pounds round or rump of beef
without bone. Sear brown on all sides in very hot frying-pan over hot
fire. In braising-pan or iron kettle put layers of sliced onions, turnips,
and carrots; add bunch of sweet herbs, 1 teaspoon salt, ½ teaspoon
pepper; on this lay meat. Add 1 pint boiling water (or water and
stewed tomatoes). Cover closely and cook 4 hours in moderate
oven. If water evaporates rapidly add more. Transfer meat to hot
platter. Strain, thicken, and season gravy. The vegetables may be
served separately if desired.
Braised Veal Shoulder.—Have shoulder boned. Fill with stuffing
(see Stuffings). Prepare bed of vegetables as for braised beef. Lay
veal on it, add 1 pint boiling water, 1 pint stewed tomatoes, ½
teaspoon salt, ¼ teaspoon pepper. Cover and cook 4 hours in
moderate oven. Uncover and brown. Serve strained gravy separately.
Broiled Steak.—Trim and wipe steak, which should be at least 1
inch thick. Rub broiler with fat, arrange steak with thickest part in
center of broiler. Have fire clear and very hot, but without blaze.
Hold steak close to fire. Turn every ½ minute, that it may sear
quickly. When ½ done season with salt and pepper. Steak 1 inch
thick will broil in 4 minutes.
Panned Steak or Chops.—Trim and wipe steak. Heat frying-pan
until it smokes all over. Rub bottom with a bit of fat. Lay in steak and
turn every 10 seconds. Keep pan very hot. Season when ½ done.
Mutton and pork chops, ham and bacon, may be panned in same
way.
If hot platter for steak is rubbed with a cut onion it will give a
delightful flavor to the meat.
Broiled Ham and Poached Eggs.—Cut slices of boiled ham of
equal size; broil on a gridiron over a clear fire; lay on a hot dish. Lay
on each a poached egg, neatly trimmed, and serve.
Beefsteak Pie (French style).—Take a nice piece of beef, rump
or sirloin, cut in small slices; slice also a little raw ham; put both in a
frying-pan, with some butter and small quantity chopped onions; let
them simmer together a short time on the fire or in the oven; add a
little flour and enough stock to make sauce; salt, pepper, chopped
parsley, and a little Worcestershire sauce as seasoning; add also a
few sliced potatoes, and cook together for about 20 minutes; put
this into a pie-dish, with a few slices of hard-boiled eggs on the top,
and cover with a layer of common paste. Bake from 15 to 20
minutes in a well-heated oven. All dark-meat pies can be treated
precisely in the same way. If poultry, leave the potatoes out.
To Boil a Ham.—A blade of mace, a few cloves, a sprig of thyme,
and 2 bay-leaves. Well soak ham in large quantity of water for 24
hours, then trim and scrape very clean; put into large stewpan, with
more than sufficient water to cover it; put in mace, cloves, thyme,
and bay-leaves. Boil 4 or 5 hours, according to weight; when done,
let it become cold in liquor in which it was boiled. Then remove rind
carefully, without injuring the fat; press cloth over it to absorb as
much of the grease as possible. It is always improved by setting in
the oven for nearly an hour, till much of the fat dries out, and it also
makes it more tender. Shake some bread raspings over the fat.
Serve cold garnished with parsley.
Boiled Mutton or Lamb.—Trim and wipe the meat. Have ready
kettle of rapidly boiling salted water. Immerse meat, boil hard 5
minutes, then reduce to gentle simmer. Allow 12 to 15 minutes per
pound. Lamb should always be well done; mutton may be rare. A
little rice may be added to water to keep meat white; if a few
vegetables are also added the pot liquor will make a good thick
soup.
Boiled Corned Beef and Turnips.—Select a piece not too salt.
The brisket is a good cut for family use when not too fat. Cook beef
in plenty cold water. Bring slowly to boil. Cook 18 minutes to the
pound after it begins to simmer. When fully ¾ done put in a dozen
turnips, peeled and quartered. When both beef and turnips are
thoroughly done dish out the beef, and lay the turnips, unmashed,
about it. Serve with drawn butter, having as a base the pot liquor.
Remaining liquor will make a good soup for next day’s dinner.
Pork Chops with Tomato Gravy.—Trim off skin and fat; rub the
chops over with a mixture of powdered sage and onion; put small
piece butter into a frying-pan; put in the chops and cook slowly, as
they should be well done. Lay chops on hot dish; add a little hot
water to gravy in pan, 1 large spoon butter rolled in flour, pepper,
salt, and sugar, and ½ cup juice drained from can tomatoes. The
tomatoes themselves can be used for a tomato omelet. Stew 5
minutes and pour over the chops and serve.
Sausages.—Have ¾ lean and ¼ fat pork chopped very fine, 1
pound salt, ¼ pound pepper, and tea-cup sage to every 40 pounds
meat. Warm the meat, that you can mix it well with your hands, do
up a part in small patties mixed with a little flour, the rest pack in
jars. When to be used, do it up in small cakes, flour the outside, fry
in butter or alone. They should not be covered while frying, or they
will fall to pieces. They should be kept where it is cool, but not
damp. To prevent sausages from bursting when cooking, never make
a hole in them with a fork while turning them.
Fried Salt Pork.—Cut fat salt pork in thin slices and soak in milk
for a few hours. Pour boiling water over, drain, and fry until crisp.
When partly fried they may be dipped into batter (see Fritters), then
finished in the same pan, turning several times.
Pork and Beans.—Soak 1 quart white beans overnight in cold
water. Drain, add fresh water, and simmer gently till tender. Put in
baking-pan and place in center, rind up, gashed, ½ pound fat salt
pork parboiled. Mix 1 teaspoon salt, ½ teaspoon dry mustard, and 1
tablespoon molasses; add to the beans, with enough boiling water
to cover. Bake 8 hours in a moderate oven, adding more water as
necessary.
Liver and Bacon.—Cut liver in ½-inch slices, soak in cold water
20 minutes, drain, dry, and roll in flour. Have pan very hot. Put in
bacon thinly sliced, turn until brown, transfer to hot platter. Fry liver
quickly in the hot fat, turning often. When done pour off all but 1 or
2 tablespoons fat, dredge in flour until it is absorbed, and stir till
brown. Add hot water gradually to make smooth gravy, season and
boil 1 minute. Serve separately.
Few people know that lamb’s liver is as tender and well flavored as
calf’s liver; it is much less expensive.
Stew, Irish.—Time, about 2 hours. 2½ pounds chops, 8
potatoes, 4 turnips, 4 small onions, nearly a quart of water. Take
some chops from loin of mutton, place them in a stewpan in
alternate layers of sliced potatoes and chops; add turnips and onions
cut into pieces, pour in nearly quart cold water; cover stewpan
closely, let stew gently till vegetables are ready to mash and greater
part of gravy is absorbed; then place in a dish; serve it up hot.
Brown Beef Stew.—Cut 2 pounds beef in small pieces. Melt
some of the fat in a pan, brown in it ½ the meat. Put rest of meat in
kettle with 1 pint cold water, let stand 20 minutes, then heat slowly.
Transfer browned meat to kettle; thicken fat with two tablespoons
browned flour, add 1 pint boiling water and stir; when thick strain
into kettle. Add 1 cup diced carrot, cover, and simmer. When half
done add 1 pint diced potatoes. Season well with salt and pepper.
Mutton Haricot.—Cut 2 pounds breast mutton in pieces, roll in
flour, and brown in drippings. Transfer to a stewpan, add 2 sliced
onions, cover with boiling water, and simmer until very tender. Add 1
pint parboiled potatoes or 1 pint boiled macaroni and 1 pint shelled
peas; season, simmer till vegetables are done.
Brown Kidney Stew.—From a beef kidney cut off the outside
meat in bits, rejecting tubes and purplish cores. Cover with cold
water; heat slowly till steaming, drain, add cold water, and heat a
second and again a third time. To the drained kidneys add 1 cup
brown sauce (see Sauces), season very highly with Worcestershire
and catsup, and stand over hot water for 10 minutes.
To Roast a Leg of Pork.—Choose a small leg of fine young pork;
cut a slit in the knuckle with a sharp knife, and fill the space with
sage, and onions chopped, and a little pepper and salt. When half
done score the skin in slices, but do not cut deeper than the outer
rind. Apple sauce and potatoes should be served to eat with it.
Sweetbreads.—Scald in salted water; remove stringy parts; put
in cold water 5 or 10 minutes; drain in towel; dip in egg and bread
or cracker crumbs, fry in butter, or broil them plain.
Veal Cutlets, Breaded.—Trim and flatten the cutlets, pepper and
salt, and roll in beaten egg, then in pounded cracker. Fry rather
slowly in good dripping, turning when the lower side is brown. Drain
off the fat, squeeze a little lemon juice upon each, and serve in a hot
flat dish.
Stuffings

VEAL STUFFING.—3 cups stale bread crumbs, 3 onions chopped


fine, 1 teaspoon salt, ½ teaspoon white pepper, 2 tablespoons
chopped parsley, ½ cup melted butter or suet.
Poultry Stuffing.—1 quart stale bread crumbs, salt, pepper, and
dried thyme to season highly, ½ cup melted butter.
Chestnut Stuffing for Poultry.—1 pint fine bread crumbs, 1
pint shelled and boiled French chestnuts chopped fine, salt, pepper,
and chopped parsley to season, ½ cup melted butter.
Oyster Stuffing for Poultry.—Substitute small raw oysters,
picked and washed, for chestnuts in foregoing receipt.
Celery Stuffing.—Substitute finely cut celery for chestnuts.
Stuffing for Pork.—3 large onions parboiled and chopped, 2
cups fine bread crumbs, 2 tablespoons powdered sage, 2
tablespoons melted butter or pork fat, salt and pepper to taste.
Stuffing for Geese and Ducks.—2 chopped onions, 2 cups
mashed potato, 1 cup bread crumbs, salt, pepper, and powdered
sage to taste.
Stuffing for Tomatoes, Green Peppers, etc.—1 cup dry bread
crumbs, ⅓ teaspoon salt, ¼ teaspoon pepper, 1 teaspoon onion
juice, 1 tablespoon chopped parsley, 2 tablespoons melted butter.
Hominy, rice, or other cooked cereal may take the place of crumbs.
Poultry

TO CLEAN POULTRY.—Put 2 tablespoons alcohol in saucer, ignite,


and over this singe the fowl. Cut off head just below bill. Untie feet,
break bone, and loosen sinews just below the joint; pull out sinews
and cut off feet. Cut out oil-sac. Lay breast down, slit skin down
backbone toward head; loosen windpipe and crop and pull them out.
Cut off neck close to body. Make small slit below end of breast-bone,
put in the fingers, loosen intestines from backbone, take firm grasp
of gizzard and draw all out. Cut round the vent so that the intestines
are unbroken. Remove heart and lungs. Remove kidneys. See that
inside looks clean, then wipe out with wet cloth. Wipe off skin with
cloth.
To Truss Poultry.—Fill inside with stuffing (see Stuffings). Have
at least 1 yard fine twine in trussing-needle. Turn wings across back
so that pinions touch. Run needle through thick part of wing under
bone, through body and wing on other side; return in same way, but
passing needle in over bone, tie firmly, leave several inches of twine.
Press legs up against body, run needle through thigh, body, and
second thigh, and return, going round bone in same way; tie firmly.
Run needle through ends of legs, return, passing needle through
rump; if opening is badly torn, 1 or 2 stitches may be needed,
otherwise not.
To Roast Poultry.—Rub all over with soft butter and sprinkle
with salt and pepper. Place on rack in roasting-pan and put in very
hot oven. Make basting-mixture with ½ cup each of butter or
chicken-fat and water; keep hot and baste every 10 or 15 minutes.
Roast 3 hours for 8-pound turkey, 1 to 1½ hours for fowls. Keep
oven very hot. If fowl is very large and heavy, cover breast and legs
with several thicknesses paper to keep from burning.
Poultry Gravy.—Pour off excess of fat in pan. Set pan on stove
and sprinkle in sufficient flour to absorb fat. Stir until well browned.
Gradually add hot water, or the chopped giblets with water in which
they were cooked; stir till smoothly thickened. Season, simmer for
few minutes, and serve.
Broiled Chicken.—Singe, split down backbone, and clean.
Grease broiler, arrange chicken on it, crossing legs and turning
wings. Rub inside and out with soft butter, and season. Have fire
clear and hot. Cook flesh side first, holding up well that it may not
brown too quickly. Should cook in about 20 or 25 minutes, then turn
and brown skin side.
Fried Spring Chicken.—Clean and disjoint, then soak in salt
water for 2 hours. Put in frying-pan equal parts of lard and butter—
in all enough to cover chicken. Roll each piece in flour, dip in beaten
egg, then roll in cracker crumbs, and drop into the boiling fat. Fry
until browned on both sides. Serve on flat platter garnished with
sprigs of parsley. Pour most of fat from frying-pan, thicken the
remainder with browned flour, add to it cup of boiling water or milk.
Serve in gravy-boat.
Chicken Fricassee.—Clean and disjoint chicken. Wipe each
piece. Put in pot, cover with boiling water and simmer till tender. To
the liquor add 1 cup or more hot milk, and thicken with flour
dissolved in cold water. Season well, boil up for a few minutes. Serve
with dumplings or Royal biscuit.
Brown Fricassee of Chicken.—Clean and disjoint. Brown in a
few spoons hot butter or pork fat. Transfer to a kettle. To fat in pan
add sufficient flour to absorb. Stir and brown. Gradually add 1 pint
hot water, stir till thickened, strain over chicken. Cover and simmer
gently till tender.
Chicken Pâtés.—Chop meat of cold chicken coarsely and season
well. Make large cup rich drawn butter, and while on fire stir in 2
eggs, boiled hard, minced very fine, also a little chopped parsley,
then chicken meat. Let almost boil. Have ready some pâté-pans of
good paste, baked quickly to light brown. Slip from pans while hot,
fill with mixture and set in oven to heat. Arrange upon dish and
serve hot.
Boned Chicken.—Boil a chicken in little water as possible until
meat will fall from bones; remove all skin, chop together light and
dark parts; season with pepper and salt. Boil down liquid in which
chicken was boiled, then pour it on meat; place in tin, wrap tightly in
cloth, press with heavy weight several hours. Serve cold, cut in thin
slices.
Chicken Pot-pie.—2 large chickens disjointed and boiled in 2
quarts water; add a few slices salt pork; season. When nearly
cooked, add crust made of 1 quart flour, 4 teaspoons Royal Baking
Powder, 1 saltspoon salt; stir in stiff batter with water; drop into
kettle while boiling; cover close and cook 25 minutes.
Chicken Pot-pie, 2.—Disjoint 2 fowls and cook in 2 quarts water
till very tender. Slip out bones and season. Line sides of clean kettle
with rich biscuit crust (see Biscuits). Add chicken and thickened
liquor. Stand on moderately hot fire. Build fire of dry cobs or small
sticks round kettle, and keep burning till crust is well browned. Put
chicken on platter and lay crust on it. Old-fashioned receipt.
Make thick dumpling batter (see Dumplings). Drop by spoonfuls
into thickened boiling liquor, cover closely for 20 minutes. New
receipt.
Chicken Pie.—Take 2 full-grown chickens, or more if small,
disjoint them, cut backbone, etc., small as convenient. Boil them
with few slices of salt pork in water enough to cover them, let boil
quite tender, then take out breast-bone. After they boil and scum is
taken off, put in a little onion out very fine—not enough to taste
distinctly, just enough to flavor a little; rub some parsley very fine
when dry, or cut fine when green—this gives pleasant flavor. Season
well with pepper and salt, and few ounces good fresh butter. When
all is cooked well, have liquid enough to cover chicken, then beat 2
eggs and stir in some sweet cream. Line 5-quart pan with crust
made like Royal Baking Powder biscuit, only more shortening, put in
chicken and liquid, cover with crust same as lining. Bake till crust is
done, and you will have a good chicken pie.
Creamed Chicken.—Make 1 cup cream sauce (see Sauces).
Prepare 2 cups diced cooked chicken. Add to sauce, season well,
simmer 10 minutes.
Meat and Fish Sauces

WHITE OR CREAM SAUCE.—Put 1 tablespoon each of butter and


flour in saucepan over fire. When mixed without browning add ½
teaspoon salt, ¼ teaspoon white pepper, then, gradually, 1 cup hot
milk. Stir until smoothly thickened, and simmer for 3 minutes.
Thick White or Cream Sauce.—Make as above, but use double
quantities of flour and butter.
Bechamel Sauce.—1 tablespoon each of flour and butter, ½ cup
each thin cream and white stock—chicken or veal—salt and pepper
to taste. Prepare same manner as white sauce.
Allemande Sauce.—Same as white sauce, with addition of 2 raw
egg yolks added as taken from fire.
Egg Sauce (for Fish).—1 cup white sauce, 2 chopped hard-
boiled eggs, 1 tablespoon chopped parsley, 1 teaspoon lemon juice
or vinegar. Add parsley after taking from fire.
Caper Sauce.—2 tablespoons butter, 1 tablespoon flour; mix
well; pour on boiling water till it thickens; add 1 hard-boiled egg
chopped fine, and 2 tablespoons capers.
Drawn Butter.-½ cup butter, 2 tablespoons flour; rub thoroughly
together, then stir into pint boiling water; little salt; parsley if
wished.
Curry Sauce.—Slowly cook 1 tablespoon chopped onion in 1
tablespoon butter 5 minutes without coloring. Add 1 teaspoon curry
powder, cook 2 minutes, add 1 cup white sauce, cook 2 minutes
longer.
Soubise Sauce.—Peel 3 large white onions; boil very soft in
salted water. Drain, rub through sieve, add 1 cup white sauce.
Bread Sauce.—Cook in double boiler for 15 minutes 1 pint milk,
2 tablespoons chopped onion; add 1 tablespoon butter, ½ teaspoon
salt, ¼ teaspoon pepper, and rub through sieve. Brown ½ cup
coarse dry bread crumbs in 1 tablespoon butter in frying-pan. Add
these to sauce as it goes to table.
Brown Sauce.—In saucepan brown 1 tablespoon butter until
dark, but not burned. Add 1 tablespoon flour, stir and brown again.
Add gradually 1 cup good stock (beef is best) or hot water and stir
until smooth and thick. Season with salt and pepper to taste.
Simmer 5 minutes.
Sauce Piquante.—To 1 cup brown sauce add 1 tablespoon each
of chopped capers and pickles and simmer 5 minutes.
Mushroom Sauce.—Make 1 cup brown sauce, using equal
quantities stock and liquor from canned mushrooms. Season, add 2
tablespoons chopped mushrooms, simmer 5 minutes.
Sharp Brown Sauce.—1 tablespoon butter, 1 tablespoon flour, 3
tablespoons vinegar, 1 tablespoon tomato catsup, ⅔ cup stock.
Make same way as brown sauce, add salt and pepper to taste.
Sauce Robert.—1 cup brown sauce made with stock, 1 teaspoon
sugar, 1 teaspoon made mustard, 1 tablespoon vinegar. Simmer 5
minutes.
Olive Sauce.—1 cup brown sauce, 24 stoned olives, 1 tablespoon
sherry. Simmer olives in hot water 10 minutes. Drain, add sauce,
simmer 5 minutes; take from fire and add sherry.
Spanish Sauce.—Boil 1 quart strong stock down one half. Make
as directed for brown sauce, and add 2 tablespoons sherry.
Currant Jelly Sauce.—Melt ½ glass currant jelly over slow fire.
Add 1 cup hot brown sauce; stir well and simmer 1 minute.
Tomato Sauce.—Simmer ½ can tomatoes, 1 chopped onion, ½
teaspoon salt, ¼ teaspoon pepper, 1 clove together 10 minutes. Rub
through sieve. Cook together 1 tablespoon each of flour and butter 1
minute, add tomato gradually, stir till smooth, and simmer 5
minutes.
Italian Tomato Sauce.—Simmer together for 20 minutes ½ can
tomatoes, 6 cloves, 3 sprigs parsley, 1 teaspoon mixed herbs, ½
teaspoon whole allspice, ½ teaspoon peppercorns. Slowly brown 2
tablespoons chopped onion and 1 tablespoon butter until very dark;
add 2 tablespoons flour, brown again; add gradually 1 cup rich
brown stock, then the cooked tomatoes. Simmer 10 minutes, rub
through a sieve and add more seasoning if necessary.
Hollandaise Sauce.—Cream ½ cup butter; add gradually 2
beaten egg yolks; stir well. Add 1 tablespoon lemon juice, dash each
of salt and cayenne. Add ½ cup boiling water, and stir over boiling
water till thick as boiled custard. Serve immediately.
Sauce Tartare.—Make 1 cup mayonnaise (see Salads). Chop
very fine 1 tablespoon each of capers, olives, green cucumber pickle,
and parsley. Press in a cloth till quite dry. Blend gradually with the
mayonnaise. For fried or broiled fish.
Maître d’Hôtel Butter.—Cream 2 tablespoons butter, add
gradually ½ teaspoon salt, ⅛ teaspoon white pepper, 1 tablespoon
each of lemon juice and chopped parsley. Keep very cold. Serve with
fried fish or broiled steak.
Horse-radish Sauce.—Cream 2 tablespoons butter; add 2
tablespoons fresh grated horse-radish, 1 tablespoon very thick
cream, ½ teaspoon lemon juice. Keep very cold.
Mint Sauce.—1 cup chopped green mint leaves, ½ cup vinegar,
¼ cup powdered sugar. Mix 1 hour before serving.
Salads and Cheese

MAYONNAISE.—Have dishes and ingredients very cold. If summer,


set dish in pan of pounded ice. In soup-plate or shallow bowl put
yolk 1 raw egg, add ¼ teaspoon salt and dash cayenne, a few drops
of Tobasco and a teaspoon Worcestershire sauce, stir with fork till
very thick. Add few drops olive oil and stir; add more oil, few drops
at a time, until mixture balls on fork. Thin with few drops lemon
juice or vinegar, then add more oil. Alternate in this way until 1 cup
olive oil is used and dressing is thick and glossy, like a jelly. About 3
tablespoons lemon juice or 2 of vinegar will be needed, according to
its acidity. Always stir in the same direction. Keep covered and on ice
until needed.
French Dressing.—Mix ¼ teaspoon salt, dash white pepper, and
3 tablespoons olive oil. Stir for few minutes, then gradually add 1
tablespoon vinegar, stirring rapidly until mixture is slightly thickened
and vinegar cannot be noticed. Mixture will separate after about 20
minutes.
Boiled Dressing.—3 beaten eggs, 1 cup rich milk, ⅔ teaspoon
dry mustard, 2 teaspoons salt, 2 dashes cayenne, 2 tablespoons
olive oil or melted butter, ½ cup vinegar. Cook in double boiler till
thick as custard. Strain and keep in cold place.
Cream Dressing.—1 cup cream, 1 tablespoon flour, 3
tablespoons vinegar, 2 tablespoons butter, ½ teaspoon powdered
sugar, 1 teaspoon salt, ¼ teaspoon pepper, ½ teaspoon dry
mustard, whites 2 eggs. Cook in double boiler, stirring constantly,
and adding whipped whites just before taking from fire.
Celery Salad.—2 bunches celery, 1 tablespoon salad oil, 4
tablespoons vinegar, 1 small teaspoon fine sugar, pepper and salt to
taste. Wash and scrape celery; lay in ice-cold water until dinner-
time. Then cut into inch lengths, add above seasoning. Stir well
together with fork and serve in salad-bowl.
Chicken Salad.—Cut cold roast or boiled chicken in small dice,
add ½ as much blanched celery cut fine, season with salt and
pepper. Mix with French dressing and set away for an hour or more.
Just before serving stir in some mayonnaise slightly thinned with
lemon juice or French dressing, arrange on lettuce leaves and cover
with thick mayonnaise.
Lobster Salad.—Tear the meat of lobster into shreds with two
forks, and let it get cold. Mix with blanched celery cut in small
pieces-¼ celery, ¾ lobster. Mix with mayonnaise. Make cups of
small blanched leaves of lettuce, fill with salad, garnish with
mayonnaise, capers, and lobster coral. Keep on ice until served.
Salmon Salad.—Remove bones and skin from can salmon. Drain
off liquid. Mix with French dressing or thin mayonnaise; set aside for
a while. Finish same as lobster salad. Other fish salads may be
prepared in same manner.
Tomato Salad.—Pare with sharp knife. Slice and lay in salad-
bowl. Make dressing as follows: Work up saltspoon each of salt,
pepper, and fresh made mustard with 2 tablespoons of salad oil,
adding only a few drops at a time, and, when thoroughly mixed,
whip in with an egg, beaten, 4 tablespoons vinegar; toss up with
fork.
Cucumber and Onion Salad.—Pare cucumbers and lay in ice-
water 1 hour; do same with onions in another bowl. Then slice them
in proportion of 1 onion to 3 large cucumbers; arrange in salad-
bowl, and season with vinegar, pepper, and salt.
Potato Salad.—Make ½ amount of boiled dressing given; when
cold, thin with vinegar or lemon juice, and add 2 tablespoons onion
juice. Pour over diced boiled potatoes while hot. When cold serve
with watercress or field salad, garnishing with diced pickled beets
and sliced hard-boiled egg.
Potato and Egg Salad.—Hard boil 3 eggs 30 minutes; shell and
cut fine with silver knife. Boil 3 or 4 potatoes. Dice while hot, mix
with cut eggs and add French dressing. Let stand till cold. Serve on
bed of watercress with more French dressing or boiled dressing
thinned with vinegar.
Cold Slaw.—Prepare ½ quantity boiled dressing. While hot pour
over 1 quart shaved cabbage, cover closely; set away till cold. Red
cabbage may also be used.
Cheese Straws.—Roll out pie crust, 5, very thin. Sprinkle with
grated sharp cheese and a dust of cayenne, fold in three, roll out,
and dust a second time with cheese. Fold, roll out quite thin, cut in
fine strips or straws with jagging-iron, lay on flat pans and bake in
very moderate oven.
Welsh Rarebit.—Select richest and best American cheese, the
milder the better, as melting brings out strength. To make 5 rarebits,
take 1 pound cheese, grate and put in tin or porcelain-lined
saucepan; add ale (old is best) enough to thin the cheese
sufficiently, say about a wine-glass to each rarebit. Place over fire,
stir until it is melted. Have slice of toast ready for each rarebit
(crusts trimmed); put a slice on each plate, and pour cheese enough
over each piece to cover it. Serve while hot.
Eggs

SOFT AND HARD BOILED EGGS.—For soft boiled drop into


boiling water and boil 3 to 3½ minutes. A better way is to have
water boiling in a saucepan. Take from fire, add eggs quickly, cover,
and let stand off fire away from drafts from 8 to 10 minutes,
according to freshness of eggs.
Hard boiled eggs should be simmered at least 20 minutes. This
gives mealy yolks, which digest more readily than sodden ones.
Poached Eggs.—Toast small slice of bread for each egg; trim and
lay on hot platter. Have frying-pan partly filled with salted water.
When simmering, carefully break in 1 egg at a time. Baste with the
water until white is firm, take up with skimmer, trim edge of white
and slip on toast.
Scrambled Eggs.—Beat together 4 eggs, ½ cup cream or rich
milk, ½ teaspoon salt, ¼ teaspoon pepper. Turn into hot buttered
pan, stir till set. Serve on toast.
Chopped boiled ham or other cold meat may be mixed with the
eggs before cooking.
Omelet.—Break 3 eggs in bowl; add 1 teaspoon cold water. Beat
with fork till mixed. Add ½ teaspoon salt. Turn into very hot buttered
pan, shake and stir till eggs begin to set. Let form, fold and turn out
on hot platter.
Fancy Omelets.—Finely chopped cooked meats, vegetables cut
fine, chopped parsley, etc., may be added to plain omelet and dish
named according to what is added, as ham omelet, omelet with
peas, etc.
Orange or other Sweet Omelet.—Separate and whip whites
and yolks of 3 eggs. Pour yolks over whites, add grated rind of
orange and 1 tablespoon of orange juice, 1 tablespoon powdered
sugar. Mix and cook as above.
Omelet Soufflé.—Break 6 eggs into separate cups; beat 4 of the
yolks, mix with them teaspoon flour, 3 tablespoons powdered sugar,
very little salt; flavor with extract lemon or any other flavors that
may be preferred. Whisk the whites of the 6 eggs to firm froth; mix
them lightly with yolks; pour the mixture into a greased pan or dish;
bake in quick oven. When well risen and lightly browned on the top
it is done; roll out in dish, sift pulverized sugar over and send to
table. You can also pour some rum over it and set it on fire, as for
an omelet au rhum.
Plain and Fancy Baked Eggs.—Butter small stoneware dishes.
Carefully break egg in each. Add salt, pepper, and bit of butter. Bake
in oven till white is set.
May be varied by buttering dish and adding chopped parsley or
ham, soaked bread crumbs, chopped onions, or a little stewed
tomato.
Vegetables

HINTS ON COOKING VEGETABLES.—First—Have them fresh as


possible. Summer vegetables should be cooked on same day they
are gathered. Second—Look them over and wash well, cutting out all
decayed or unripe parts. Third—Lay them, when peeled, in cold
water for some time before using. Fourth—Always let water boil
before putting them in, and continue to boil until done.
Turnips.—Should be peeled, and boiled from 40 minutes to an
hour.
Beets.—Boil from 1 to 2 hours; then put in cold water and slip skin
off.
Spinach.—Boil 20 minutes.
Parsnips.—Boil from 20 to 30 minutes.
Onions.—Best boiled in 2 or 3 waters, adding milk the last time.
String Beans.—Should be boiled 1½ hours.
Shell Beans.—Require an hour.
Green Corn.—Boil 20 or 30 minutes.
Green Peas.—Should be boiled in little water as possible; boil 20
minutes.
Asparagus.—Same as peas; serve on toast with cream gravy.
Winter Squash.—Cut in pieces and boil 20 to 40 minutes in small
quantity of water; when done, press water out, mash smooth,
season with butter, pepper, and salt.
Cabbage.—should be boiled from 1 to 2 hours in plenty of water;
salt while boiling.
Asparagus on Toast.—Have stalks of equal length; scrape lower
ends; tie in small bunches with tape. Cook 20 to 30 minutes,
according to size. Dip 6 or 8 slices dry toast in asparagus liquor, lay
on hot platter, place asparagus on them, and cover with a white or
drawn butter sauce; in making sauce use asparagus liquor and water
or milk in equal quantities.
String Beans.—Top and tail the beans, and strip off all strings
carefully; break into short lengths and wash. Boil in salted water
until tender—from 1½ to 3 hours. Drain, season with butter, salt,
and pepper.
Kidney Beans, Brown Sauce.—Cook 1 pint fresh shelled beans
in salted water till tender. Drain; shake in saucepan with 1 teaspoon
butter 3 minutes. Add 1 cup brown sauce (see Sauces), and simmer
5 minutes.
Beets, Cream Sauce.—Wash and boil beets till tender. Rub off
skins and slice or dice. To 1 pint add 1 cup white sauce (see
Sauces); simmer 5 minutes. Other root vegetables may be finished
same way.
Boiled Cabbage.—Strip off outer leaves, cut in quarters, cut out
stalk. Soak in salted water 1 hour. Drain. Have kettle of rapidly
boiling water. Add ½ teaspoon baking soda and cabbage. Cover and
keep at galloping boil. Unless very old, cabbage will be done in 1
hour. Press out all water; season well; put in hot dish.
Carrots and other Root Vegetables.—Scrape or pare carrots,
parsnips, turnips. Dice and cook gently in unsalted water till tender.
Drain and reheat in seasoned butter, 1 tablespoon to 1 pint, or in a
drawn butter or white sauce. In early summer, when roots are small,
water should be salted. Onions should also be boiled in salted water,
then finished as here directed.
Stewed Corn.—Husk corn. Draw sharp knife down center of each
row of grains; press out pulp with back of knife. To 1 pint add ½
teaspoon salt, ½ teaspoon sugar, dash pepper, ½ cup cream or rich
milk. Heat and simmer 10 minutes.
Corn Pudding.—To 1 pint scraped corn pulp add 4 beaten eggs,
1 pint milk, 1 teaspoon salt, ⅓ teaspoon pepper. Mix, bake in
moderate oven till set in center.
Fried Egg Plant.—Wipe the egg plant, cut in ¼—inch slices,
soak in salted cold water 1 hour. Dip each slice in beaten egg and fry
in butter until inside is very soft, outside brown.
Fried Onions.—Peel (holding onions and hands under water to
prevent tears), wash and cut crosswise so as to form undivided
rings. Flour them, fry 5 or 6 minutes. Drain, sprinkle with salt and
pepper, and serve with beefsteak.
Fried Potatoes.—Pare raw potatoes; cut thin as wafers with
sharp knife or patent slicer. Soak 20 minutes in cold water; dry on
towel. Throw a handful at a time in kettle of smoking-hot fat; skim
out fast as browned and drain on unglazed paper. Sprinkle with salt.
Fried Potatoes, 2.—Cut cold boiled potatoes in thick slices,
season and sauté in a little hot fat in a frying-pan.
Mashed Potatoes.—Boil potatoes in salted water; while hot put
through ricer or mash with fork till smooth. Season with salt and
pepper; to 1 pint add 1 tablespoon butter and 2 tablespoons hot
milk. Beat till light, heap in hot dish.
Baked Potatoes.—Scrub potatoes of same size. Bake in very hot
oven until tender. Press till skin breaks slightly, serve hot with butter.
Potato Croquettes.—Mix together 1 pint hot mashed potato, 1
teaspoon salt, ⅓ teaspoon pepper, 1 teaspoon onion juice, 1
tablespoon butter, 1 tablespoon chopped parsley, yolks 2 beaten
eggs. Stir over fire till mixture leaves sides of saucepan. When cool,
shape into croquettes, dip each in beaten egg, roll in crumbs, and
fry brown in deep kettle of smoking-hot fat.
Lyonnaise Potatoes.—Heat 1 tablespoon butter in frying-pan.
Add 1 tablespoon chopped onion. When pale brown add 1 pint diced
boiled potatoes, seasoned. Shake till butter is absorbed; potatoes
should not color. Add 1 tablespoon chopped parsley and take up.
Creamed Potatoes.—To 3 cups diced boiled potatoes add 1 pint
cream sauce (see Sauces), more seasoning if necessary, and simmer
10 minutes. Or, season cold sliced potatoes, cover with milk, and
stew till milk is reduced one half, then add a little butter.
Stewed Squash.—Pare small squash, remove seeds, boil in
salted water till tender. Drain, mash, season, and stir over slow fire
till quite dry. Add butter and seasoning to taste.
Stewed Tomatoes.—Scald and skin tomatoes, remove hard ends
and cut up. Stew in agate saucepan till tender, add salt, pepper, and
sugar to taste, also 1 teaspoon butter to each pint. If liked, thicken
with fine crumbs or with a little flour dissolved in cold water.
Stuffed Tomatoes.—Choose large tomatoes; cut off stem ends
and take out centers. Fill with stuffing (see Stuffings), lay on
buttered baking-pan, and bake in hot oven 30 minutes. Peppers,
summer squash, large ripe cucumbers, onions, and egg plant may
be prepared in same way.
Panned Tomatoes.—Cut firm tomatoes in halves. For 4, heat 1
tablespoon butter in frying-pan. Dip tomatoes in flour, put cut side
down in pan, cover, and cook over hot fire until browned. Transfer to
hot dish, sprinkle 1 tablespoon flour in pan, stir, add 1 cup milk; stir
till thickened, season, boil 1 minute, and pour round tomatoes.
Mashed Turnips.—Pare and dice turnips, boil in unsalted water
till tender. Mash, adding salt, pepper, and butter to taste. If cut small
they will cook in less time and be less odorous.
Ragout of Vegetables.—Parboil 1 carrot, 1 turnip, 2 potatoes, 2
ears of corn, 1 cup of lima beans, and the same of peas, 1 onion,
and with them ¼ pound of fat salt pork. Drain off the water and lay
aside the pork. Slice carrots, turnips, potatoes, and onion. Put into a
saucepan with a cup of some good meat soup before it has been
thickened. Season well; cut the corn from the cob and add with the
peas, beans, and a sliced tomato as soon as the rest are hot. Stew
all together ½ hour. Stir in a great lump of butter rolled in flour.
Stew 5 minutes, and serve in a deep dish.
Dried Sweet Corn.—Soak 1 pint overnight. Drain, add fresh cold
water, and cook slowly. When tender drain, add ½ cup rich milk, 1
tablespoon butter, salt and pepper to taste, simmer 10 minutes.
Boiled Rice.—Wash 1 cup rice through several waters till water
runs off clear. Have at least 4 quarts rapidly boiling water in kettle.
Add rice and 1 tablespoon salt. Boil at a gallop until rice is tender—
this takes 12 to 20 minutes according to kind and age of rice. Drain,
set colander over boiling water for 10 minutes or more to steam.
Each grain will be distinct yet tender.
Macaroni.—Have a large kettle nearly full of rapidly boiling salted
water. Break macaroni into 2 or 3 inch lengths, drop into the water,
and boil as directed for rice until tender, which will take from 30 to
45 minutes. Drain, then pour cold water through the colander to
remove pastiness. Reheat in a little butter, or in a white, brown, or
tomato sauce. Before sending to table, sprinkle thickly with grated
cheese or stir the cheese through it.
Spaghetti, vermicelli, or any of the forms of paste may be
prepared in the same way.
Pickles, Etc.

USE glass bottles for pickles, also wooden knives and forks in
preparation of them. Fill bottles 3 parts full with articles to be
pickled, then fill bottle with vinegar. Use saucepans lined with
earthenware, or stone pipkins, to boil vinegar in.
Chow Chow.—1 quart large cucumbers, 1 quart small
cucumbers, 2 quarts onions, 4 heads cauliflower, 6 green peppers, 1
quart green tomatoes, 1 gallon vinegar, 1 pound mustard, 2 cups
sugar, 2 cups flour, 1 ounce turmeric. Put all in salt and water one
night; cook all the vegetables in brine until tender, except large
cucumbers. Pour over vinegar and spices.
Pickling Cauliflowers.—Take whitest and closest cauliflowers in
bunches; spread on earthen dish, cover them with salt, and let stand
3 days to draw out all the water. Then put in jars, pour boiling salt
and water over them, let stand overnight; then drain with a hair-
sieve, and put in glass jars; fill up jars with vinegar; cover tight.
Piccalilly.—1 peck green tomatoes, sliced; ½ peck onions, sliced;
1 cauliflower, 1 peck small cucumbers. Leave in salt and water 24
hours; then put in kettle with handful scraped horse-radish, 1 ounce
turmeric, 1 ounce cloves (whole), ¼ pound pepper (whole), 1 ounce
cassia-buds or cinnamon, 1 pound white mustard seed, 1 pound
English mustard. Place in kettle in layers, and cover with cold
vinegar. Boil 15 minutes, constantly stirring.
Pickled Red Cabbage.—Slice it into a colander, sprinkle each
layer with salt; let it drain 2 days, then put into a jar, pour boiling
vinegar enough to cover, put in a few slices of red beet-root. Choose
purple red cabbage. Those who like flavor of spice will boil it with
the vinegar. Cauliflower cut in bunches, and thrown in after being
salted, will look red and beautiful.
Tomato Catsup.—1 gallon tomatoes (strained), 6 tablespoons
salt, 3 tablespoons black pepper, 1 tablespoon cloves, 2 tablespoons
cinnamon, 2 tablespoons allspice, 1½ pints vinegar; boil down one
half. 1 peck tomatoes will make 1 gallon strained.
Walnut Catsup.—Take green walnuts before the shell is formed
(usually in a proper state early in August). Grind them or pound
them in an earthen or marble mortar. Squeeze out the juice through
a coarse cloth, and add to every gallon of juice 1 pound of
anchovies, 1 pound salt, 4 ounces cayenne pepper, 2 ounces black
pepper, 1 ounce each ginger, cloves, and mace, and the root of one
horse-radish. Boil all together till reduced to half the quantity. Pour
off, and when cold bottle tight. Use in 3 months.
Beverages

BOILED COFFEE.—For 4 heaping tablespoons ground coffee allow


1 quart freshly boiling water and ½ white 1 raw egg. Mix the egg
white with 3 tablespoons cold water, beating with fork. Add coffee
and stir till well wet. Scald coffee-pot, put in prepared coffee. Pour in
boiling water, cover spout, and boil 5 minutes. Pour in quickly ¼ cup
cold water, let stand 3 minutes to settle. Strain into hot pot or have
strainer on table.
Coffee for Six Persons.—Take 1 full cup ground coffee, 1 egg, a
little cold water; stir together, add 1 pint boiling water, boil up; then
add another pint boiling water, and set back to settle before serving.
French Coffee.—1 quart water to 1 cup very fine ground coffee.
Put coffee grounds in bowl; pour over about ½ pint cold water and
let stand for 15 minutes; bring remaining water to a boil. Take coffee
in bowl, strain through fine sieve, then take French coffee-pot, put
coffee grounds in strainer at top of French pot, leaving water in
bowl. Then take boiling water and pour over coffee very slowly. Then
set coffee-pot on stove 5 minutes; must not boil. Take off and pour
in cold water from bowl that coffee was first soaked in, to settle.
Serve in another pot. The French, who have the reputation of
making the best coffee, use 3 parts Java, 1 part Mocha.
Vienna Coffee.—Equal parts Mocha and Java coffee; allow 1
heaping tablespoon of coffee to each person, and 2 extra to make
good strength. Mix 1 egg with grounds, pour on coffee ½ as much
boiling water as will be needed, let coffee froth, then stir down
grounds and let boil 5 minutes; then let coffee stand where it will
keep hot, but not boil, for 5 or 10 minutes, and add rest of water. To
1 pint cream add white of an egg, well-beaten; this is to be put in
cups with sugar, and hot coffee added.
Tea.—Water for tea should be freshly heated and just boiling.
Teas are of differing strengths, but a safe rule is 1 teaspoon dry tea
to ½ pint boiling water. Scald tea-pot; put in dry tea and cover for 1
minute. Add boiling water, cover closely. Let stand 3 to 6 minutes,
strain off into second hot pot. A wadded cozy will keep tea hot for a
long time off the fire.
Cocoa.—The usual rule is 1 teaspoon cocoa to each cup. Mix dry
cocoa with little cold water, add scalded milk or boiling water, and
boil 1 minute.
Chocolate.—1 square unsweetened chocolate, 1 tablespoon
sugar, 2 tablespoons hot water. Grate chocolate, boil all together till
smooth, add gradually 1 pint scalded milk, cook in double boiler 5
minutes. Some like to add 1 teaspoon vanilla. It can be made
stronger by using more chocolate.
Cookery for the Sick

ALWAYS prepare food for the sick in the neatest and most careful
manner. In sickness the senses are unusually acute, and far more
susceptible to carelessness, negligence, and mistakes in the
preparation and serving of food than when in health.
Corn Meal Gruel.—Mix 1 tablespoon corn meal, ½ teaspoon salt,
and 2 tablespoons cold water. Add 1 pint boiling water, simmer
slowly 1 hour. In serving bowl put 2 tablespoons cream, 1 lump
sugar, strain in gruel, stir for a moment, and serve.
Flour and arrowroot gruel is made in the same way, but cooked
only 10 minutes.
Farina gruel is made with milk and cooked 1 hour in double boiler.
Boil oatmeal gruel 1 hour and strain.
Barley Water.—Wash 2 tablespoons pearl barley, scald with
boiling water, boil 5 minutes, strain. Add 2 quarts cold water, simmer
till reduced ½. Strain, add lemon juice to taste. Good in fevers.
Wine Whey.—Scald 1 cup milk, add 1 cup wine, cook gently till it
wheys. Strain through cheese-cloth.
Beef Tea.—Chop very fine 1 pound lean beef round. Cover with
½ pint cold water. Stand in cold place 1 hour. Set over hot water, stir
till liquid begins to turn color. Strain, add pinch salt. To reheat, set
cup in pan of hot water.
Restorative Jelly.—Put in glass jar ½ box granulated gelatine, 1
tablespoon granulated gum arabic, 2 cloves, 3 tablespoons sugar, 2
tablespoons lemon juice, 1 cup port wine. Stand in kettle cold water,
heat till all is dissolved. Strain into shallow dish. Chill. Cut in ½-inch
squares.

You might also like