100% found this document useful (6 votes)
59 views

Full Download (Ebook) Learn TensorFlow 2.0: Implement Machine Learning and Deep Learning Models with Python by Pramod Singh , Avinash Manure ISBN 9781484255582, 1484255585 PDF DOCX

The document provides information about various eBooks related to machine learning and deep learning, including titles like 'Learn TensorFlow 2.0' and 'Learn PySpark'. It includes links for downloading these eBooks in multiple formats and highlights the authors' backgrounds and expertise. Additionally, it outlines the contents of the book 'Learn TensorFlow 2.0', covering topics such as supervised learning, neural networks, and natural language processing.

Uploaded by

julmerkityan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (6 votes)
59 views

Full Download (Ebook) Learn TensorFlow 2.0: Implement Machine Learning and Deep Learning Models with Python by Pramod Singh , Avinash Manure ISBN 9781484255582, 1484255585 PDF DOCX

The document provides information about various eBooks related to machine learning and deep learning, including titles like 'Learn TensorFlow 2.0' and 'Learn PySpark'. It includes links for downloading these eBooks in multiple formats and highlights the authors' backgrounds and expertise. Additionally, it outlines the contents of the book 'Learn TensorFlow 2.0', covering topics such as supervised learning, neural networks, and natural language processing.

Uploaded by

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

Download the Full Ebook and Access More Features - ebooknice.

com

(Ebook) Learn TensorFlow 2.0: Implement Machine


Learning and Deep Learning Models with Python by
Pramod Singh , Avinash Manure ISBN 9781484255582,
1484255585
https://ebooknice.com/product/learn-
tensorflow-2-0-implement-machine-learning-and-deep-learning-
models-with-python-50195358

OR CLICK HERE

DOWLOAD EBOOK

Download more ebook instantly today at https://ebooknice.com


Instant digital products (PDF, ePub, MOBI) ready for you
Download now and discover formats that fit your needs...

Start reading on any device today!

(Ebook) Learn PySpark: Build python-based machine learning


and deep learning models by Pramod Singh ISBN
9781484249604, 9781484249611, 1484249607, 1484249615
https://ebooknice.com/product/learn-pyspark-build-python-based-
machine-learning-and-deep-learning-models-11863258

ebooknice.com

(Ebook) Python Machine Learning. Machine Learning and Deep


Learning with Python, scikit-learn and TensorFlow by
Sebastian Raschka, Vahid Mirjalili ISBN 9781787125933,
1787125939
https://ebooknice.com/product/python-machine-learning-machine-
learning-and-deep-learning-with-python-scikit-learn-and-
tensorflow-6868034
ebooknice.com

(Ebook) Applied Deep Learning with TensorFlow 2: Learn to


Implement Advanced Deep Learning Techniques with Python by
Umberto Michelucci ISBN 9781484280195, 1484280199
https://ebooknice.com/product/applied-deep-learning-with-
tensorflow-2-learn-to-implement-advanced-deep-learning-techniques-
with-python-42639904
ebooknice.com

(Ebook) Deep Learning with Python: Develop Deep Learning


Models on Theano and TensorFLow Using Keras by Jason
Brownlee
https://ebooknice.com/product/deep-learning-with-python-develop-deep-
learning-models-on-theano-and-tensorflow-using-keras-7295338

ebooknice.com
(Ebook) Deep Learning with Python: Learn Best Practices of
Deep Learning Models with PyTorch by Nikhil Ketkar, Jojo
Moolayil ISBN 9781484253632, 1484253639
https://ebooknice.com/product/deep-learning-with-python-learn-best-
practices-of-deep-learning-models-with-pytorch-23971132

ebooknice.com

(Ebook) Deep Learning with Python: Learn Best Practices of


Deep Learning Models with PyTorch by Nikhil Ketkar, Jojo
Moolayil ISBN 9781484253632, 1484253639
https://ebooknice.com/product/deep-learning-with-python-learn-best-
practices-of-deep-learning-models-with-pytorch-23971134

ebooknice.com

(Ebook) Machine Learning Concepts with Python and the


Jupyter Notebook Environment: Using Tensorflow 2.0 by
Nikita Silaparasetty ISBN 9781484259665, 9781484259672,
1484259661, 148425967X
https://ebooknice.com/product/machine-learning-concepts-with-python-
and-the-jupyter-notebook-environment-using-tensorflow-2-0-22417452

ebooknice.com

(Ebook) Deep Learning for Finance: Creating Machine & Deep


Learning Models for Trading in Python by Kaabar, Sofien
ISBN 9781098148393, 1098148398
https://ebooknice.com/product/deep-learning-for-finance-creating-
machine-deep-learning-models-for-trading-in-python-56363826

ebooknice.com

(Ebook) Deep Learning for Finance: Creating Machine & Deep


Learning Models for Trading in Python by Sofien Kaabar
ISBN 9781098148393, 1098148398
https://ebooknice.com/product/deep-learning-for-finance-creating-
machine-deep-learning-models-for-trading-in-python-54868706

ebooknice.com
Learn
TensorFlow 2.0
Implement Machine Learning and
Deep Learning Models with Python

Pramod Singh
Avinash Manure

www.allitebooks.com
Learn TensorFlow 2.0
Implement Machine Learning
and Deep Learning Models
with Python

Pramod Singh
Avinash Manure

www.allitebooks.com
Learn TensorFlow 2.0: Implement Machine Learning and Deep Learning
Models with Python
Pramod Singh Avinash Manure
Bangalore, Karnataka, India Bangalore, India

ISBN-13 (pbk): 978-1-4842-5560-5 ISBN-13 (electronic): 978-1-4842-5558-2


https://doi.org/10.1007/978-1-4842-5558-2

Copyright © 2020 by Pramod Singh, Avinash Manure


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: James Markham
Coordinating Editor: Aditee Mirashi
Cover designed by eStudioCalamar
Cover image designed by Freepik (www.freepik.com)
Distributed to the book trade worldwide by Springer Science+Business Media New York,
233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505,
e-mail orders-ny@springer-sbm.com, 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 rights@apress.com, or visit www.apress.com/
rights-permissions.
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 www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the authors in this book is available
to readers on GitHub, via the book’s product page, located at www.apress.com/978-1-4842-5560-5.
For more detailed information, please visit www.apress.com/source-code.
Printed on acid-free paper

www.allitebooks.com
I dedicate this book to my wife, Neha, my son, Ziaan, and
my parents. Without you, this book wouldn’t have
been possible. You complete my world and are the
source of my strength.
—Pramod Singh

I dedicate this book to my wife, Jaya, for constantly


encouraging me to do the best in whatever I undertake,
and also my mom and dad, for their unconditional love
and support, which have made me what I am today.
Last but not least, my thanks to Pramod, for trusting me
and giving me the opportunity to coauthor this book.
—Avinash Manure

www.allitebooks.com
Table of Contents
About the Authors��������������������������������������������������������������������������������ix
About the Technical Reviewer�������������������������������������������������������������xi
Acknowledgments�����������������������������������������������������������������������������xiii
Introduction����������������������������������������������������������������������������������������xv

Chapter 1: Introduction to TensorFlow 2.0�������������������������������������������1


Tensor + Flow = TensorFlow���������������������������������������������������������������������������������2
Components and Basis Vectors�����������������������������������������������������������������������3
Tensor�������������������������������������������������������������������������������������������������������������������6
Rank����������������������������������������������������������������������������������������������������������������7
Shape��������������������������������������������������������������������������������������������������������������7
Flow�����������������������������������������������������������������������������������������������������������������7
TensorFlow 1.0 vs. TensorFlow 2.0�����������������������������������������������������������������������9
Usability-Related Changes����������������������������������������������������������������������������10
Performance-Related Changes���������������������������������������������������������������������16
Installation and Basic Operations in TensorFlow 2.0������������������������������������������17
Anaconda�������������������������������������������������������������������������������������������������������17
Colab�������������������������������������������������������������������������������������������������������������17
Databricks�����������������������������������������������������������������������������������������������������19
Conclusion����������������������������������������������������������������������������������������������������������24

www.allitebooks.com
Table of Contents

Chapter 2: Supervised Learning with TensorFlow������������������������������25


What Is Supervised Machine Learning?��������������������������������������������������������������25
Linear Regression with TensorFlow 2.0��������������������������������������������������������������28
Implementation of a Linear Regression Model, Using TensorFlow and Keras����29
Logistic Regression with TensorFlow 2.0������������������������������������������������������������37
Boosted Trees with TensorFlow 2.0���������������������������������������������������������������������47
Ensemble Technique��������������������������������������������������������������������������������������47
Gradient Boosting������������������������������������������������������������������������������������������49
Conclusion����������������������������������������������������������������������������������������������������������52

Chapter 3: Neural Networks and Deep Learning with TensorFlow�����53


What Are Neural Networks?��������������������������������������������������������������������������������53
Neurons���������������������������������������������������������������������������������������������������������54
Artificial Neural Networks (ANNs)������������������������������������������������������������������55
Simple Neural Network Architecture�������������������������������������������������������������57
Forward and Backward Propagation�������������������������������������������������������������������58
Building Neural Networks with TensorFlow 2.0�������������������������������������������������61
About the Data Set����������������������������������������������������������������������������������������61
Deep Neural Networks (DNNs)����������������������������������������������������������������������������67
Building DNNs with TensorFlow 2.0��������������������������������������������������������������������68
Estimators Using the Keras Model����������������������������������������������������������������������71
Conclusion����������������������������������������������������������������������������������������������������������74

Chapter 4: Images with TensorFlow���������������������������������������������������75


Image Processing�����������������������������������������������������������������������������������������������76
Convolutional Neural Networks���������������������������������������������������������������������������77
Convolutional Layer���������������������������������������������������������������������������������������77
Pooling Layer�������������������������������������������������������������������������������������������������80
Fully Connected Layer�����������������������������������������������������������������������������������81

vi
Table of Contents

ConvNets Using TensorFlow 2.0��������������������������������������������������������������������������82


Advanced Convolutional Neural Network Architectures��������������������������������������89
Transfer Learning������������������������������������������������������������������������������������������������93
Transfer Learning and Machine Learning������������������������������������������������������95
Variational Autoencoders Using TensorFlow 2.0�������������������������������������������������97
Autoencoders������������������������������������������������������������������������������������������������97
Applications of Autoencoders������������������������������������������������������������������������98
Variational Autoencoders�������������������������������������������������������������������������������98
Implementation of Variational Autoencoders Using TensorFlow 2.0��������������99
Conclusion��������������������������������������������������������������������������������������������������������106

Chapter 5: Natural Language Processing with TensorFlow 2.0��������107


NLP Overview����������������������������������������������������������������������������������������������������107
Text Preprocessing��������������������������������������������������������������������������������������������109
Tokenization������������������������������������������������������������������������������������������������110
Word Embeddings���������������������������������������������������������������������������������������112
Text Classification Using TensorFlow����������������������������������������������������������������113
Text Processing�������������������������������������������������������������������������������������������115
Deep Learning Model����������������������������������������������������������������������������������119
Embeddings�������������������������������������������������������������������������������������������������120
TensorFlow Projector����������������������������������������������������������������������������������������123
Conclusion��������������������������������������������������������������������������������������������������������129

Chapter 6: TensorFlow Models in Production�����������������������������������131


Model Deployment��������������������������������������������������������������������������������������������132
Isolation�������������������������������������������������������������������������������������������������������133
Collaboration�����������������������������������������������������������������������������������������������133
Model Updates���������������������������������������������������������������������������������������������134

vii
Table of Contents

Model Performance�������������������������������������������������������������������������������������134
Load Balancer����������������������������������������������������������������������������������������������134
Python-Based Model Deployment���������������������������������������������������������������������135
Saving and Restoring a Machine Learning Model���������������������������������������135
Deploying a Machine Learning Model As a REST Service���������������������������138
Templates����������������������������������������������������������������������������������������������������142
Challenges of Using Flask���������������������������������������������������������������������������145
Building a Keras TensorFlow-Based Model�������������������������������������������������������146
TF ind deployment��������������������������������������������������������������������������������������������151
Conclusion��������������������������������������������������������������������������������������������������������159

Index�������������������������������������������������������������������������������������������������161

viii
About the Authors
Pramod Singh is currently employed as a
machine learning expert at Walmart Labs. He
has extensive hands-on experience in machine
learning, deep learning, artificial intelligence
(AI), data engineering, designing algorithms,
and application development. He has spent
more than ten years working on multiple
data projects at different organizations. He’s
the author of three books: Machine Learning
with PySpark, Learn PySpark, and Learn TensorFlow 2.0. He is also a
regular speaker at major tech conferences, such as O’Reilly Strata Data
and AI Conferences. Pramod holds a BTech in electrical engineering from
Mumbai University and an MBA from Symbiosis University. He also holds
data science certification from IIM–Calcutta. Pramod lives in Bangalore,
India, with his wife and three-­year-­old son. In his spare time, he enjoys
playing guitar, coding, reading, and watching football.

ix
About the Authors

Avinash Manure is a senior data scientist


at Publicis Sapient with more than eight
years of experience using data to solve real-
world business challenges. He is proficient
in deploying complex machine learning and
statistical modeling algorithms/techniques to
identify patterns and extract valuable insights
for key stakeholders and organizational
leadership.
Avinash holds a bachelor’s degree in electronics engineering from
Mumbai University and holds an MBA in marketing from the University
of Pune. He and his wife are currently settled in Bangalore. He enjoys
traveling to new places and reading motivational books.

x
About the Technical Reviewer
Jojo Moolayil is an AI professional and author
of three books on machine learning, deep
learning, and the Internet of Things (IoT). He
is currently working as a research scientist—AI
at Amazon Web Services, in their Vancouver,
British Columbia, office.
Jojo was born and raised in Pune, India,
and graduated from the University of Pune
with a major in information technology
engineering. His passion for problem solving
and data-driven decision making led him to start a career with Mu
Sigma Inc., the world’s largest pure-play analytics provider. There, he
was responsible for developing machine learning and decision science
solutions to complex problems for major health care and telecom
companies. He later worked with Flutura (an IoT analytics startup) and
General Electric, with a focus on industrial AI, in Bangalore.
In his current role with Amazon, he works on researching and developing
large-scale AI solutions to combat fraud and enrich the customers’ payment
experience in the cloud. Jojo is also actively involved as a tech reviewer and
AI consultant to leading publishers and has reviewed more than a dozen
books on machine learning, deep learning, and business analytics.
You can reach Jojo at the following:

• www.jojomoolayil.com/

• www.linkedin.com/in/jojo62000

• twitter.com/jojo62000

xi
Acknowledgments
This is my third book with Apress, and a lot of thought went into writing
it. The main objective was to introduce to the IT community the critical
changes introduced in the new version of TensorFlow. I hope readers will
find it useful, but first, I’d like to thank a few people who helped me along
the journey. First, I must thank the most important person in my life, my
beloved wife, Neha, who selflessly supported me throughout and sacrificed
so much to ensure that I completed this book.
I must also thank my coauthor, Avinash Manure, who expended a great
amount of effort to complete the project on time. In addition, my thanks to
Celestin Suresh John, who believed in me and offered me this opportunity
to write another book for Apress. Aditee Mirashi is one of the best editors
in India. This is my third book with her, and it was quite exciting to
collaborate again. She was, as usual, extremely supportive and always
available to accommodate my requests. To James Markham, who had
the patience to review every line of code and check the appropriateness
of each example, thank you for your feedback and your encouragement.
It really made a difference to me and the book. I also want to thank my
mentors who have constantly encouraged me to chase my dreams. Thank
you Sebastian Keupers, Dr. Vijay Agneeswaran, Sreenivas Venkatraman,
Shoaib Ahmed, and Abhishek Kumar.
Finally, I am infinitely grateful to my son, Ziaan, and my parents, for
the endless love and support, irrespective of circumstances. You all make
my world beautiful.
—Pramod Singh

xiii
Acknowledgments

This is my first book, and a very special one indeed. As mentioned by


Pramod, the objective of this book is to introduce readers to TensorFlow
2.0 and explain how this platform has evolved over the years to become
one of the most popular and user-friendly source libraries for machine
learning currently available. I would like to thank Pramod for having
confidence in me and giving me the golden opportunity to coauthor this
book. As this is my first book, Pramod has been guiding and helping me to
complete it.
I would like to thank my wife, Jaya, who made sure I had the right
environment at home to concentrate and complete this book on time. I
would also like to thank the publishing team—Aditee Mirashi, Matthew
Moodie, and James Markham—who have helped me immensely in
ensuring that this book reaches the audience in its best state. I would
also like to thank my mentors, who made sure I grew professionally and
personally by always supporting me in my dreams and guiding me toward
them. Thank you Tristan Bishop, Erling Amundson, Deepak Jain, Dr.
Vijay Agneeswaran, and Abhishek Kumar for all the support that you have
extended to me. Last but not least, I would like to acknowledge my parents,
my friends, and colleagues, who have always been there in my tough times
and motivated me to follow my dreams.
—Avinash Manure

xiv
Introduction
Google has been a pioneer in introducing groundbreaking technology and
products. TensorFlow is no exception, when it comes to efficiency and
scale, yet there have been some adoption challenges that have convinced
Google’s TensorFlow team to implement changes to facilitate ease of use.
Therefore, the idea of writing this book was simply to introduce to readers
these important changes made by the TensorFlow core team. This book
focuses on different aspects of TensorFlow, in terms of machine learning,
and goes deeper into the internals of the recent changes in approach. This
book is a good reference point for those who seek to migrate to TensorFlow
to perform machine learning.
This book is divided into three sections. The first offers an introduction
to data processing using TensorFlow 2.0. The second section discusses
using TensorFlow 2.0 to build machine learning and deep learning models.
It also includes neuro-linguistic programming (NLP) using TensorFlow 2.0.
The third section covers saving and deploying TensorFlow 2.0 models in
production. This book also is useful for data analysts and data engineers,
as it covers the steps of big data processing using TensorFlow 2.0. Readers
who want to transition to the data science and machine learning fields
will also find that this book provides a practical introduction that can lead
to more complicated aspects later. The case studies and examples given
in the book make it really easy to follow and understand the relevant
fundamental concepts. Moreover, there are very few books available
on TensorFlow 2.0, and this book will certainly increase the readers’

xv
Introduction

knowledge. The strength of this book lies in its simplicity and the applied
machine learning to meaningful data sets.
We have tried our best to inject our entire experience and knowledge
into this book and feel it is specifically relevant to what businesses are
seeking to solve real challenges. We hope you gain some useful takeaways
from it.

xvi
CHAPTER 1

Introduction
to TensorFlow 2.0
The intent of this book is to introduce readers to the latest version of the
TensorFlow library. Therefore, this first chapter focuses mainly on what has
changed in the TensorFlow library since its first version, TensorFlow 1.0.
We will cover the various changes, in addition to highlighting the specific
parts for which changes are yet to be introduced. This chapter is divided
into three sections: the first discusses the internals of TensorFlow;
the second focuses on the changes that have been implemented in
TensorFlow 2.0 after TensorFlow 1.0; and the final section covers
TensorFlow 2.0 installation methods and basic operations.
You may already be aware that TensorFlow is widely used as a
machine learning implementation library. It was created by Google
as part of the Google Brain project and was later made available as an
open source product, as there were multiple machine learning and
deep learning frameworks that were capturing the attention of users.
With open source availability, more and more people in the artificial
intelligence (AI) and machine learning communities were able to adopt
TensorFlow and build features and products on top of it. It not only
helped users with implementation of standard machine learning and
deep learning algorithms but also allowed them to implement customized
and differentiated versions of algorithms for business applications and

© Pramod Singh, Avinash Manure 2020 1


P. Singh and A. Manure, Learn TensorFlow 2.0,
https://doi.org/10.1007/978-1-4842-5558-2_1
Chapter 1 Introduction to TensorFlow 2.0

various research purposes. In fact, it soon became one of the most popular
libraries in the machine learning and AI communities—so much so that
people have been building a huge number of apps using TensorFlow
under the hood. This is principally owing to the fact that Google itself uses
TensorFlow in most of its products, whether Google Maps, Gmail,
or other apps.
While TensorFlow had its strengths in certain areas, it also had a few
limitations, owing to which developers found it a bit difficult to adopt,
compared to such other libraries as PyTorch, Theano, and OpenCV. As
Google’s TensorFlow team took the feedback of the TensorFlow
community seriously, it went back to the drawing board and started
working on most of the changes required to make TensorFlow even more
effective and easy to work with, soon launching the TensorFlow 2.0 alpha
version this year. TensorFlow 2.0 claims to have removed some of the
previous hurdles, in order to allow developers to use TensorFlow even
more seamlessly. In this chapter, we will go over those changes one by one,
but before covering these, let us spend some time understanding what
exactly TensorFlow is and what makes it one of the best available options
to perform machine learning and deep learning today.

Tensor + Flow = TensorFlow


Tensors are the building blocks of TensorFlow, as all computations are
done using tensors. So, what exactly is a tensor?
According to the definition provided by Google’s TensorFlow team,
A tensor is a generalization of vectors and matrices to poten-
tially higher dimensions. Internally, TensorFlow represents
tensors as n-dimensional arrays of base datatypes.
But we would like to delve a little deeper into tensors, in order to
provide more than a general overview of what they are. We would like to
compare them with vectors or matrices, so as to highlight the key dynamic

2
Chapter 1 Introduction to TensorFlow 2.0

property that makes tensors so powerful. Let us start with a simple vector.
A vector is commonly understood as something that has a magnitude and
a direction. Simply put, it is an array that contains an ordered list of values.
Without the direction of a vector, a tensor becomes a scalar value that has
only magnitude.
A vector can be used to represent n number of things. It can represent
area and different attributes, among other things. But let’s move beyond
just magnitude and direction and try to understand the real components
of a vector.

Components and Basis Vectors


Let’s suppose we have a vector Â, as shown in Figure 1-1. This is currently
represented without any coordinate system consideration, but most of us
are already aware of the Cartesian coordinate system (x, y, z axis).

Figure 1-1. Simple vector

If the vector  is represented in a three-dimensional space, it will look


something like what is shown in Figure 1-2. This vector  can also be
represented with the help of basis vectors.

3
Chapter 1 Introduction to TensorFlow 2.0

Figure 1-2. Types of variables

Basis vectors are associated with the coordinate system and can be used
to represent any vector. These basis vectors have a length of 1 and, hence, are
also known as unit vectors. The direction of these basis vectors is determined
by their respective coordinates. For example, for three-­dimensional
representation, we have three basis vectors (xˆ , y,
ˆ zˆ ), so x̂ would have the
direction of the x axis coordinate, and the ŷ basis vector would have the
direction of the y axis. Similarly, this would be the case for ẑ.
Once the basis vectors are present, we can use the coordinate system
to find the components that represent the original vector Â. For simplicity,
and to understand the components of the vector well, let’s reduce the
coordinate system from three dimensions to two. So, now the vector Â
looks something like what is shown in Figure 1-3.

Figure 1-3. 2-dimensional view

4
Chapter 1 Introduction to TensorFlow 2.0

To find the first component of the vector  along the x axis, we


will project it onto the x axis, as shown in Figure 1-4. Now, wherever
the projection meets the x axis is known as the x component, or first
component, of the vector.

Figure 1-4. Vector Magnitude

If you look carefully, you can easily recognize this x component as the
sum of a few basis vectors along the x axis. In this case, adding three basis
vectors will give the x component of vector Â. Similarly, we can find the y
component of vector  by projecting it on the y axis and adding up the
basis vectors (2 ŷ) along the y axis to represent it. In simple terms, we can
think of this as how much one has to move in the x axis direction and y axis
direction in order to reach vector Â.

 = 3 xˆ + 2 yˆ

One other thing worth noting is that as the angle between vector Â
and the x axis increases, the x component decreases, but the y component
increases. Vectors are part of a bigger class of objects known as tensors.
If we end up multiplying a vector with another vector, we get a result
that is a scalar quantity, whereas if we multiply a vector with a scalar
value, it just increases or decreases in the same proportion, in terms of
its magnitude, without changing its direction. However, if we multiply

5
Chapter 1 Introduction to TensorFlow 2.0

a vector with a tensor, it will result in a new vector that has a changed
magnitude as well as a new direction.

T ensor
At the end of the day, a tensor is also a mathematical entity with which to
represent different properties, similar to a scalar, vector, or matrix. It is true
that a tensor is a generalization of a scalar or vector. In short, tensors are
multidimensional arrays that have some dynamic properties. A vector is a
one-dimensional tensor, whereas two-dimensional tensors are matrices
(Figure 1-5).

Figure 1-5. Tensors

Tensors can be of two types: constant or variable.

6
Chapter 1 Introduction to TensorFlow 2.0

R
 ank
Ranking tensors can sometimes be confusing for some people, but in terms
of tensors, rank simply indicates the number of directions required to
describe the properties of an object, meaning the dimensions of the array
contained in the tensor itself. Breaking this down for different objects, a
scalar doesn’t have any direction and, hence, automatically becomes a
rank 0 tensor, whereas a vector, which can be described using only one
direction, becomes a first rank tensor. The next object, which is a matrix,
requires two directions to describe it and becomes a second rank tensor.

S
 hape
The shape of a tensor represents the number of values in each dimension.

Scalar—32: The shape of the tensor would be [ ].

Vector—[3, 4, 5]: The shape of the first rank tensor


would be [3].
1 2 3
Matrix = 4 5 6 : The second rank tensor would
7 8 9
have a shape of [3, 3].

F low
Now comes the second part of TensorFlow: flow. This is basically an
underlying graph computation framework that uses tensors for its
execution. A typical graph consists of two entities: nodes and edges, as
shown in Figure 1-6. Nodes are also called vertices.

7
Chapter 1 Introduction to TensorFlow 2.0

Figure 1-6. Typical graph

The edges are essentially the connections between the nodes/vertices


through which the data flows, and nodes are where actual computation
takes place. Now, in general, the graph can be cyclic or acyclic, but in
TensorFlow, it is always acyclic. It cannot start and end at the same node.
Let’s consider a simple computational graph, as shown in Figure 1-7, and
explore some of its attributes.

Figure 1-7. Computational graph

8
Chapter 1 Introduction to TensorFlow 2.0

The nodes in the graph indicate some sort of computation, such as


addition, multiplication, division, etc., except for the leaf nodes, which
contain the actual tensors with either constant or variable values to be
operated upon. These tensors flow through the edges or connections
between nodes, and the computation at the next node results in formation
of a new tensor. So, in the sample graph, a new tensor m is created through
a computation at the node using other tensors x and y. The thing to focus
on in this graph is that computations take place only at the next stage
after leaf nodes, as leaf nodes can only be simple tensors, which become
input for next-node computation flowing through edges. We can also
represent the computations at each node through a hierarchical structure.
The nodes at the same level can be executed in parallel, as there is no
interdependency between them. In this case, m and n can be calculated
in parallel at the same time. This attribute of graph helps to execute
computational graphs in a distributed manner, which allows TensorFlow
to be used for large-scale applications.

TensorFlow 1.0 vs. TensorFlow 2.0


Although TensorFlow was well adopted by the IT community after it was
made available on an open source basis, there were still a lot of gaps, in
terms of its user-friendliness. Users found it somewhat difficult to write
TensorFlow-based code. Therefore, there was a lot of critical feedback
by the developer and research communities regarding a few aspects of
TensorFlow. As a result, the TensorFlow core development team started
incorporating the suggested changes, to make the product easier to use
and more effective. This section reviews those changes that have been
incorporated into the TensorFlow 2.0 beta version. There are mainly three
broad categories of changes that have been introduced in TensorFlow 2.0.

9
Chapter 1 Introduction to TensorFlow 2.0

1. Usability-related modifications

2. Performance-related modifications

3. Deployment-related modifications

In this chapter, we are going to focus on only the first two categories, as
Chapter 6 covers TensorFlow model deployment.

U
 sability-Related Changes
The first category of changes mainly focused on TensorFlow’s ease of use
and more consistent APIs. To go through these changes in detail, we have
further subcategorized them according to three broad types.

1. Simpler APIs

2. Improved documentation

3. More inbuilt data sources

S
 impler APIs
One of the most common criticisms of TensorFlow by users regarded its
APIs, which were not user-friendly, thus a major focus of TensorFlow 2.0
has been on overhauling its APIs. Now, TensorFlow 2.0 provides two levels
of APIs:

1. High-level APIs

2. Lower-level APIs

High-Level APIs
The high-level APIs make it easier to use TensorFlow for various
applications, as these APIs are more intuitive in nature. These new high-­
level APIs have made debugging relatively easier than in earlier versions.
As TensorFlow 1.0 was graph control–based, users were not able to debug

10
Chapter 1 Introduction to TensorFlow 2.0

their programs easily. TensorFlow 2.0 has now introduced eager execution,
which performs operations and returns output instantly.

Lower-Level APIs
Another available set of APIs are lower level APIs which offer much more
flexibility and configuration capability to the users in order to define and
parameterise the models as per their specific requirements.

Session Execution

Readers who have used earlier versions of TensorFlow must have gone
through the conventional procedure, session execution, to get to an
operational graph, which likely consisted of the following steps:

1. First, create the tf.Graph object and set it to the


default graph for the current scope.

2. Declare the computation part in TensorFlow:


c=tf.matmul(m,n).

3. Define the variable sharing and scope, as required.

4. Create and configure the tf.Session to build the


graph and connect to the tf.Session.

5. Initialize all the variables in advance.

6. Use the tf.Session.run method to start the


computation.

7. The tf.Session.run then triggers a procedure to


compute the final output.

11
Chapter 1 Introduction to TensorFlow 2.0

Eager Execution

With eager execution, TensorFlow 2.0 adopts a radically different approach


and removes the need to execute most of the preceding steps.

1. TensorFlow 2.0 doesn’t require the graph definition.

2. TensorFlow 2.0 doesn’t require the session


execution.

3. TensorFlow 2.0 doesn’t make it mandatory to


initialize variables.

4. TensorFlow 2.0 doesn’t require variable sharing via


scopes.

To understand these differences in detail, let’s consider an example


using TensorFlow 1.0 vs. TensorFlow 2.0.

[In]: import tensorflow as tf


[In]: tfs=tf.InteractiveSession()
[In]: c1=tf.constant(10,name='x')
[In]: print(c1)
[Out]: Tensor("x:0", shape=(), dtype=int32)
[In]: tfs.run(c1)
[Out]: 10

Import the new version of TensorFlow.

[In]: ! pip install -q tensorflow==2.0.0-beta1


[In]: import tensorflow as tf
[In]: print(tf.__version__)
[Out]: 2.0.0-beta1
[In]: c_1=tf.constant(10)
[In]: print(c_1)
[Out]: tf.Tensor(10, shape=(), dtype=int32)

# Operations

12
Chapter 1 Introduction to TensorFlow 2.0

TensorFlow 1.0

[In]: c2=tf.constant(5.0,name='y')
[In]: c3=tf.constant(7.0,tf.float32,name='z')
[In]: op1=tf.add(c2,c3)
[In]: op2=tf.multiply(c2,c3)
[In]: tfs.run(op2)
[Out]: 35.0
[In]: tfs.run(op1)
[Out]: 12.0

TensorFlow 2.0

[In]:c2= tf.constant(5.0)
[In]:c3= tf.constant(7.0)
[In]: op_1=tf.add(c2,c3)
[In]: print(op_1)
[Out]: tf.Tensor(12.0, shape=(), dtype=float32)
[In]: op_2=tf.multiply(c2,c3)
[In]: print(op_2)
[Out]: tf.Tensor(35.0, shape=(), dtype=float32)

TensorFlow 1.0

g = tf.Graph()
with g.as_default():
    a = tf.constant([[10,10],[11.,1.]])
    x = tf.constant([[1.,0.],[0.,1.]])
    b = tf.Variable(12.)
    y = tf.matmul(a, x) + b
    init_op = tf.global_variables_initializer()

with tf.Session() as sess:


    sess.run(init_op)
    print(sess.run(y))

13
Chapter 1 Introduction to TensorFlow 2.0

TensorFlow 2.0

a = tf.constant([[10,10],[11.,1.]])
x = tf.constant([[1.,0.],[0.,1.]])
b = tf.Variable(12.)
y = tf.matmul(a, x) + b
print(y.numpy())

Note With TensorFlow 1.0 graph execution, the program state


(such as variables) is stored in global collections, and their lifetime
is managed by the tf.Session object. By contrast, during eager
execution, the lifetime of state objects is determined by the lifetime of
their corresponding Python object.

tf.function
Another powerful introduction of TensorFlow 2.0 is its tf.function
capability, which converts relevant Python code into a formidable
TensorFlow graph. It combines the flexibility of eager execution and
strength of graph computations. As mentioned, TensorFlow 2.0 doesn’t
require the creation of a tf.session object. Instead, simple Python
functions can be translated into a graph, using the tf.function decorator.
In simple terms, in order to define a graph in TensorFlow 2.0, we must
define a Python function and decorate it with @tf.function.

Keras
tf.keras was originally meant for small-scale models, as it had very
simple APIs, but it was not scalable. TensorFlow also had introduced
estimators that were designed for scaling and distributed training of
machine learning models. Estimators had a huge advantage as they offered

14
Chapter 1 Introduction to TensorFlow 2.0

fault tolerance training in a distributed environment, but its APIs were


not very user-friendly and were often regarded as confusing and a little
hard to consume. With this in mind, TensorFlow 2.0 has introduced the
standardized version of tf.keras, which combines the simplicity of Keras
and power of estimators.
The code for tf.keras in TensorFlow versions 1.13 and 2.0 remain the
same, but what has changed under the hood is the integration of Keras
with new features of TensorFlow 2.0. To elaborate a little bit, if a particular
piece of code was run with tf.keras in version 1.13, it would build a
graph-based model that ran a session under the hood, which we initiated
in the code. In version 2.0, the same model definition would run in eager
mode, without any modification whatsoever.
With eager mode, it becomes easy to debug the code, compared to
earlier graph-based execution. In eager mode, the data set pipelines
behave exactly as those of a NumPy array, but TensorFlow takes care of the
optimization in the best possible manner. Graphs are still very much part
of TensorFlow but operate in the background.

Redundancy
Another useful feedback from the community regarding TensorFlow usage
was that there were too many redundant components, which created
confusion when using them in different places. For example, there were
multiple optimizers and layers that one had to choose from while building
the model. TensorFlow 2.0 has removed all the redundant elements and
now comes with just one set of optimizers, metrics, losses, and layers.
Duplicative classes have also been reduced, making it easier for users to
figure out what to use and when.

15
Chapter 1 Introduction to TensorFlow 2.0

Improved Documentation and More Inbuilt Data Sources


TensorFlow.org now contains much more exhaustive and detailed
documentation for TensorFlow. This was critical from the user’s
perspective, as earlier versions had limited examples and tutorials for
reference. This new documentation includes a lot of new data sources
(small as well as big) for users to make use of in their programs or for
learning purposes. The new APIs also make it very easy to import any new
data source in TensorFlow. Some of the data sets from different domains
that are made available within TensorFlow are shown in Table 1-1.

Table 1-1. Data Sets Within TensorFlow 2.0


Sr. No Category Data set

1 Text imdb_reviews, squad


2 Image mnist, imagenet2012 , coco2014, cifar10
3 Video moving_mnist, starcraft_video,
bair_robot_pushing_small
4 Audio Nsynth
5 Structured titanic, iris

P
 erformance-Related Changes
The TensorFlow development team also claims that new changes have
improved product performance over earlier versions. Based on training
and inference results using different processors (GPUs, TPUs), it seems
TensorFlow has improved its speed two times, on average.

16
Chapter 1 Introduction to TensorFlow 2.0

Installation and Basic Operations


in TensorFlow 2.0
There are multiple ways in which we can use TensorFlow (local as well as
cloud). In this section, we go over two ways in which TensorFlow 2.0 can
be used locally as well as in the cloud.

1. Anaconda

2. Colab

3. Databricks

A
 naconda
This is the simplest way of using TensorFlow on a local system. We can pip
install the latest version of TensorFlow, as follows:

[In]: pip install -q tensorflow==2.0.0-beta1

C
 olab
The most convenient way to use TensorFlow, provided by Google’s
TensorFlow team, is Colab. Short for Colaboratory, this represents the idea
of collaboration and online laboratories. It is a free Jupyter-based web
environment requiring no setup, as it comes with all the dependencies
prebuilt. It provides an easy and convenient way to let users write
TensorFlow code within their browser, without having to worry about any
sort of installations and dependencies. Let’s go over the steps to see how to
use Google Colab for TensorFlow 2.0.

1. Go to https://colab.research.google.com. You
will see that the console has multiple options, as
shown in Figure 1-8.

17
Chapter 1 Introduction to TensorFlow 2.0

Figure 1-8. Python Notebook Colaboratory (Colab) console

2. Select the relevant option from the console, which


contains the following five tabs:

a. Examples. Shows the default notebooks provided in Colab

b. Recent. The last few notebooks that the user worked on

c. Google Drive. The notebooks linked to the user’s Google


Drive account

d. GitHub. The option to link the notebooks present in the user’s


GitHub account

e. Upload. The option to upload a new ipynb or github file

3. Click New Python 3 Notebook, and a new Colab


notebook will appear, as shown in Figure 1-9.

18
Chapter 1 Introduction to TensorFlow 2.0

Figure 1-9. New notebook

4. Install and import TensorFlow 2.0 (Beta).

[In]:! pip install -q tensorflow==2.0.0-beta1


[In]: import tensorflow as tf
[In]: print(tf.__version__)
[Out]: 2.0.0-beta1

Another great advantage of using Colab is that it allows you to build


your models on GPU in the back end, using Keras, TensorFlow, and
PyTorch. It also provides 12GB RAM, with usage up to 12 hours.

D
 atabricks
Another way to use TensorFlow is through the Databricks platform. The
method of installing TensorFlow on Databricks is shown following, using
a community edition account, but the same procedure can be adopted for
business account usage as well. The first step is to log in to the Databricks
account and spin up a cluster of desired size (Figures 1-10–1-12).

19
Chapter 1 Introduction to TensorFlow 2.0

Figure 1-10. Databricks

Figure 1-11. Clusters

20
Chapter 1 Introduction to TensorFlow 2.0

Figure 1-12. Cluster settings

Once the cluster is up and running, we go to the Libraries options of


the cluster, via Actions, as shown in Figure 1-13.

Figure 1-13. Cluster library

Within the Libraries tab, if the cluster already has a set of pre-installed
libraries, they will be listed, or, in the case of a new cluster, no packages
will be installed. We then click the Install New button (Figure 1-14).

21
Chapter 1 Introduction to TensorFlow 2.0

Figure 1-14. Installing a new library

This will open a new window with multiple options to import or


install a new library in Databricks (Figure 1-15). We select PyPI, and in
the Package option, we mention the version of TensorFlow required to be
installed, as shown in Figure 1-16.

Figure 1-15. PyPI source

Figure 1-16. TensorFlow package

22
Chapter 1 Introduction to TensorFlow 2.0

It will take some time, and we can then see TensorFlow successfully
installed in Databricks, under Libraries. We can now open a new or
existing notebook using the same cluster (Figures 1-17 and 1-18).

Figure 1-17. Running cluster

Figure 1-18. New notebook

The final step is simply to import TensorFlow in the notebook and


validate the version. We can print the TensorFlow version, as shown in
Figure 1-19.

23
Chapter 1 Introduction to TensorFlow 2.0

Figure 1-19. TensorFlow notebook

Conclusion
In this chapter, we explained the fundamental difference between a vector
and a tensor. We also covered the major differences between previous
and current versions of TensorFlow. Finally, we went over the process
of installing TensorFlow locally as well as in a cloud environment (with
Databricks).

24
CHAPTER 2

Supervised Learning
with TensorFlow
In this chapter, we will be explaining the concept of supervised machine
learning. Next, we take a deep dive into such supervised machine learning
techniques as linear regression, logistic regression, and boosted trees.
Finally, we will demonstrate all the aforementioned techniques, using
TensorFlow 2.0.

What Is Supervised Machine Learning?


First, let us quickly review the concept of machine learning and then see
what supervised machine learning is, with the help of an example.
As defined by Arthur Samuel in 1959, machine learning is the field
of study that gives computers the ability to learn without being explicitly
programmed. The aim of machine learning is to build programs whose
performance improves automatically with some input parameters, such as
data, performance criteria, etc. The programs become more data-driven,
in terms of making decisions or predictions. We may not be aware of it,
but machine learning has taken over our daily lives, from recommending
products on online portals to self-driving cars that can take us from point
A to point B without our driving them or employing a driver.

© Pramod Singh, Avinash Manure 2020 25


P. Singh and A. Manure, Learn TensorFlow 2.0,
https://doi.org/10.1007/978-1-4842-5558-2_2
Chapter 2 Supervised Learning with TensorFlow

Machine learning is a part of artificial intelligence (AI) and mainly


comprises three types:

1. Supervised machine learning

2. Unsupervised machine learning

3. Reinforcement learning

Let us explore supervised machine learning via an example and


then implement different techniques using TensorFlow 2.0. Note that
unsupervised machine learning and reinforcement learning are beyond
the scope of this book.
Imagine a three-year-old seeing a kitten for the first time. How would
the child react? The child doesn’t know what he/she is seeing. He or she
might initially experience a feeling of curiosity, fear, or joy. It is only after
his or her parents pet the kitten that the child realizes the animal might not
harm him/her. Later, the child might be comfortable enough to hold the
kitten and play with it. Now, the next time the child sees a kitten, he/she
may instantly recognize it and start playing with it, without the initial fear
or curiosity it felt toward the kitten previously. The child has learned that
the kitten is not harmful, and, instead, he/she can play with it. This is how
supervised learning works in real life.
In the machine world, supervised learning is done by providing a
machine inputs and labels and asking it to learn from them. For example,
using the preceding example, we can provide to the machine pictures
of kittens, with the corresponding label (kitten), and ask it to learn the
intrinsic features of a kitten, so that it can generalize well. Later, if we
provide an image of another kitten without a label, the machine will be
able to predict that the image is that of a kitten.
Supervised learning usually comprises two phases: training and
testing/prediction. In the training phase, a set of the total data, called
a training set, is provided to the machine learning algorithm, made up
of input data (features) as well as output data (labels). The aim of the

26
Chapter 2 Supervised Learning with TensorFlow

training phase is to make sure the algorithm learns as much as possible


from the input data and forms a mapping between input and output, such
that it can be used to make predictions. In the test/prediction phase, the
remaining set of data, called a test set, is provided to the algorithm and
comprises only the input data (features) and not the labels. The aim of the
test/prediction phase is to check how well the model is able to learn and
generalize. If the accuracy of the training and test sets differs too much,
we can infer that the model might have mapped the input and output of
training data too closely, and, therefore, it was not able to generalize the
unseen data (test set) well. This is generally known as overfitting.
A typical supervised machine learning architecture is shown in
Figure 2-1.

Figure 2-1. Supervised machine learning architecture

27
Chapter 2 Supervised Learning with TensorFlow

Within supervised learning, if we are to predict numeric values, this


is called regression, whereas if we are to predict classes or categorical
variables, we call that classification. For example, if the aim is to predict
the sales (in dollars) a company is going to earn (numeric value), this
comes under regression. If the aim is to determine whether a customer will
buy a product from an online store or to check if an employee is going to
churn or not (categorical yes or no), this is a classification problem.
Classification can be further divided as binary and multi-class.
Binary classification deals with classifying two outcomes, i.e., either yes
or no. Multi-class classification yields multiple outcomes. For example,
a customer is categorized as a hot prospect, warm prospect, or cold
prospect, etc.

Linear Regression with TensorFlow 2.0


In linear regression, as with any other regression problem, we are trying
to map the inputs and the output, such that we are able to predict the
numeric output. We try to form a simple linear regression equation:

y = mx + b

In this equation, y is the numeric output that we are interested in, and
x is the input variable, i.e., part of the features set. m is the slope of the line,
and b is the intercept. For multi-variate input features (multiple linear
regression), we can generalize the equation, as follows:

y = m1x1 + m2x2 + m3x3 + ……… + mnxn + b

where x1, x2, x3, ………, xn are different input features, m1, m2, m3, ……… mn are the
slopes for different features, and b is the intercept
This equation can also be represented graphically, as shown in
Figure 2-2 (in 2D).

28
Chapter 2 Supervised Learning with TensorFlow

Figure 2-2. Linear regression graph

Here, we can clearly see that there is a linear relation between label y
and feature inputs X.

Implementation of a Linear Regression


Model, Using TensorFlow and Keras
We will implement the linear regression method in TensorFlow 2.0, using
the Boston housing data set and the LinearRegressor estimator available
within the TensorFlow package.

1. Import the required modules.

[In]: from __future__ import absolute_import, division, print_


function, unicode_literals

[In]: import numpy as np


[In]: import pandas as pd
[In]: import seaborn as sb
[In]: import tensorflow as tf
[In]: from tensorflow import keras as ks

29
Chapter 2 Supervised Learning with TensorFlow

[In]: from tensorflow.estimator import LinearRegressor


[In]: from sklearn import datasets
[In]: from sklearn.model_selection import train_test_split
[In]: from sklearn.metrics import mean_squared_error, r2_score
[In]: print(tf.__version__)
[Out]: 2.0.0-rc1

2. Load and configure the Boston housing data set.

[In]: boston_load = datasets.load_boston()


[In]: feature_columns = boston_load.feature_names
[In]: target_column = boston_load.target
[In]: boston_data = pd.DataFrame(boston_load.data,
columns=feature_columns).astype(np.float32)
[In]: boston_data['MEDV'] = target_column.astype(np.float32)
[In]: boston_data.head()

[Out]:

3. Check the relation between the variables, using


pairplot and a correlation graph.

[In]: sb.pairplot(boston_data, diag_kind="kde")


[Out]:

30
Random documents with unrelated
content Scribd suggests to you:
"No," said Georgina, "because in our day we did not have motors;
but we did pretty well with the environment at our disposal. I
remember that Evelyn was once becalmed on the Sound all night in
a catboat with a young man, and Fanny was caught just stepping off
to a masked ball in the Garden, only—"
"I was not," said Fanny, as one who slams the door in the face of an
unwelcome guest.
"Imagine Georgy's mind being just a sink for all those old scandals!"
said Evelyn pleasantly, but without taking up the question of the
truth or falsity of the facts stated.
Although Georgy was the youngest of the three Hadley sisters she,
being unmarried, had inherited the red-brick house in Maple Street.
It had a small grass plot in front—at least, it would have been a
grass plot if the roots of the two maple trees which stood in it had
not long ago come through the soil. There was, however, a nice old-
fashioned garden at the back of the house; and the sitting room
looked out on this. Here Aunt Georgy's sofa stood, beside the fire in
winter and beside the window in summer. The room was rather
crowded with books and light blue satin furniture, and steel
engravings of Raphael Madonnas and the Death of Saint Jerome;
and over the mantelpiece hung a portrait by Sully of Aunt Georgy's
grandmother, looking, everyone said, exactly as little Evie looked
today.
It was to the circle round the blue satin sofa that people came,
bearing news—from nieces and nephews fresh from some new
atrocity, to the mayor of the town, worried over the gift of a too
costly museum. Jefferson was the sort of town that bred news. In
the first place, it was old—Washington had stopped there on his way
to or from Philadelphia once—so it had magnificent old-fashioned
ideals and traditions to be violated, as they constantly were. In the
second place, it was near New York; most of the population
commuted daily, thus keeping in close touch with all the more
dangerous features of metropolitan life. And last, everyone had
known everyone else since the cradle, and most of them were
related to one another.
There was never any dearth of news, and everyone came to
recount, not to consult. Aunt Georgy did not like to be consulted.
One presented life to her as a narrative, not as a problem. There
was no use in asking her for advice, because she simply would not
give it.
"No," she would say, holding up a thin, rather bony hand, "I can't
advise you. I lose all the wonderful surge and excitement of your
story if I know I shall have to do something useful about it at the
end. It's like reading a book for review—quite destroys my pleasure,
my sense of drama."
That was exactly what she conveyed to those who talked to her—a
sense of the drama, not of her life but of their own. The smallest
incident—the sort that most of one's friends don't even hear when it
is told to them—became so significant, so amusing when recounted
to Aunt Georgy that you went on and on—and told her things.
Even her sisters, shocked as they constantly were by something they
described as "Georgy's disloyalty to the way we were all brought
up," told her everything. Step by step, the progress, or the
decadence, by which the customs of one generation change into the
customs of the next one was fought out by the three ladies, née
Hadley, at the side of that blue satin sofa.
It began with cigarettes for girls and the new dances for both sexes.
At that remote epoch none of the nieces and nephews were old
enough either to smoke or dance; so, although the line of the battle
had been the same—Fanny and Evelyn anti and Georgy pro—the
battle itself had not been so bitter and personal as it afterward
became.
The first time that Fanny's life was permanently blighted was when
Norma, her eldest child, was called out and publicly rebuked in
dancing school for shimmying. She wept—Fanny of course, not
Norma, who didn't mind at all—and said that she could never hold
up her head again. But she must have lifted it, for it was bowed
every few months for many years subsequently. Aunt Georgy at once
sent for her niece and insisted on having a private performance of
the offensive dance, over which she laughed heartily. It looked to
her, she said, so much like the old horse trying to shake off a
horsefly.
The next time that the social fabric in Jefferson tottered and Fanny's
head was again bowed was at the discovery that the younger set
was not wearing corsets. Fanny tiptoed over and shut the sitting-
room door before she breathed this bad news into her sister's ear.
"None of them," she said.
"But you wouldn't want the boys to, would you?" answered Georgy.
Fanny explained that she meant the girls didn't.
"Mercy!" exclaimed her sister. "We were all scolded because we did.
Elderly gentlemen used to write embarrassing articles about how we
were sacrificing the health of the next generation to our vanity, and
how the Venus de Milo was the ideal feminine figure; and now these
girls are just as much scolded—"
"The worst of it is," said Fanny, rolling her eyes and not listening,
"that they take them off and leave them in the dressing room. They
say that at the Brownes' the other evening there was a pile that
high."
Still, in spite of her disapproval, Fanny's head was not so
permanently bowed this time, because every mother in Jefferson
was in the same situation. But craps struck Fanny a shrewder blow,
because her child, Norma, was a conspicuous offender here,
whereas little Evie, her sister's child, didn't care for craps. She said it
wasn't amusing.
In order to decide the point Aunt Georgy asked Norma to teach her
the game, and they were thus engaged when Mr. Gordon, the
hollow-cheeked young clergyman, came to pay his first parochial
visit. He said he wasn't at all shocked, and turned to Evie, who was
sitting demurely behind the tea table eager to give him a cup of
Aunt Georgy's excellent tea.
There was something a little mid-Victorian about Evie, and the only
blot on Aunt Georgy's perfect liberalism was that in her heart she
preferred her to the more modern nieces. Evie parted her thick light-
brown hair in the middle and had a little pointed chin, like a picture
in an old annual or a flattered likeness of Queen Victoria as a girl.
She was small and decidedly pretty, though not a beauty like her
large, rollicking, black-haired cousin Norma.
Norma's love affairs—if they were love affairs, and whether they
were or not was a topic often discussed about the blue satin sofa—
were carried on with the utmost candor. Suddenly one day it would
become evident that Norma was dancing, golfing, motoring with a
new young man. Everybody would report to Aunt Gregory the
number of hours a day that he and Norma spent together, and Aunt
Gregory would say to Norma, "Are you in love with him, Norma?"
and Norma would answer "Yes" or "No" or "I'm trying to find out."
"There's no mystery about this generation," Fanny would say.
"Why should there be?" Norma would say, and would stamp out
again, and would be heard hailing the young man of the minute,
"We're considered minus on romance, Bill"; and ten of them would
get into a car intended for four and drive away, looking like a
basketful of puppies.
But about little Evie's love affairs there was some mystery. Aunt
Georgy did not know that Evie had ever spoken to the mayor—a
middle-aged banker of great wealth—and yet one day when he
came to tell Miss Hadley about the museum he told her instead
about how Evie had refused to marry him, and how unhappy he
was. The nice young clergyman, too, who preached so interestingly
and pleased the parish in every detail, was thinking of getting
himself transferred to a city in California because the sight of an
attentive but unattainable Evie in the front pew every Sunday almost
broke his heart.
Aunt Georgy exonerated Evie from blame as far as the mayor was
concerned, but she wasn't so sure about the Reverend Mr. Gordon.
"Evie," she said, "did you try to enmesh that nice-looking man of
God?"
Evie shook her head.
"I don't get anywhere if I try, Aunt Georgy," she answered. "It has to
come of itself or not at all. If Norma sees a man she fancies she
swims out after him like a Newfoundland dog. But I have to sit on
the shore until the tide washes something up at my feet. I don't
always like what it washes up either."
The simile amused Aunt Georgy, but the more she reflected the
more she doubted its accuracy. Those tides that washed things up—
Evie had some mysterious control of them, whether she knew it or
not. Evie's method and Norma's differed enormously in technic, but
wasn't the elemental aggression about the same?
Life in Jefferson was never more interesting to Aunt Georgy than
when psychoanalysis swept over them. Of course, they had all
known about it, and read Freud, or articles about Freud; but the
whole subject was revived and made personal by the arrival of
Lisburn. Lisburn was not a doctor of medicine but of philosophy. He
was an assistant professor of psychology in a New York college. He
had written his dissertation on The Unconscious as Portrayed in
Poetic Images. With an astonishing erudition he brought all poetry
from Homer to Edna St. Vincent Millay into line with the new
psychology. Besides this, he was an exceedingly handsome young
man—tall, dark, decided, and a trifle offhand and contemptuous in
his manner. What girl could ask more? Norma did not ask a bit more.
The moment she saw him she—in Evie's language—swam out after
him. She met him at dinner one evening, and the next day her
conversation was all about dreams and fixations and inhibitions.
Mothers began to assemble rapidly about the blue satin sofa. Craps
had been vulgar, the shimmy immoral, but this was the worst of all.
"Georgy," said Fanny solemnly, "they go and sit on that young man's
piazza, and they talk about things—things which you and I did not
know existed, and if we did know they existed we did not know
words for them; and if we did know words for them we did not take
the slightest interest in them."
"Then there can't be any harm in them," said Georgy, "because I'm
sure when we were girls we took an interest in everything there was
any harm in. But it sounds to me just like a new way of holding
hands—like palmistry in our day. You remember when you took up
palmistry, Evelyn. It made me so jealous to see you holding my
young men's hands!"
"It's not at all the same thing," answered Evelyn. "There was
nothing in palmistry that wasn't perfectly nice."
"Oh, yes, there was," said Georgy. "There was that line, you know,
round the base of the two middle fingers. We all felt a little shocked
if we had it and a little disappointed if we hadn't."
But her sisters were too much worried to be amused. Their children,
they said, were talking about things that could not be named. Fanny
did name them, however, and was grimly glad to see that even
Georgy, the liberal, reeled under the blow.
She recovered enough to say, "Well, after all, is it so different? We
called people Puritans instead of saying that they had inhibitions. We
didn't say a boy had a fixation on the mother, but we called him
mother's little carpet knight. And as for dreams, Fanny, when a
young man told me he had a dream about me I did not need a
doctor of philosophy to tell me what that meant."
Even Fanny was obliged to confess that her younger son Robert had
been cured of his incipient stammer after a few interviews with
Lisburn. And the young Carters, who, after three months of
marriage, were confiding to everyone their longing for divorce, had
been reconciled. There was a dream in this—about a large white
gardenia—and there was an incident connected with it—a girl in a
florist's shop—
About this time the mayor, still worrying over the upkeep of the
museum, wanted some sort of entertainment given in order to raise
money. It was suggested that a lecture on psychoanalysis by Lisburn
would be popular. Norma was delegated to go and ask him—make
him, was the way the committee put it. Needless to say, she
returned triumphant.
Aunt Georgy was among the first to arrive at the town hall on the
evening the lecture took place. She had become curious about the
young man and wanted a front seat. She limped up the aisle, leaning
on her grandfather's heavy ivory-headed cane, with little Evie beside
her. Norma was busy taking—one might almost say snatching—
tickets at the door. It is a peculiar feature of modern life that so
much time is spent first in getting lecturers to consent to lecture and
then in drumming up an audience to hear them. But this time the
audience was not difficult to get. They came in crowds.
The mayor opened the meeting. He was not a ready speaker, and
the sight of Evie, sitting so attentive in the front row, embarrassed
him hideously. He said a few panting words about the needs of the
museum and turned the meeting over to the Reverend Mr. Gordon,
who was going to introduce the speaker—who was going, in fact, to
do a little bit more than that.
He advanced to the edge of the platform, looked down at Evie and
smiled—after all, he wasn't in the pulpit—folded his hands as if lawn
frills ought to have been dripping from them, and began:
"It is my great pleasure and privilege to introduce the speaker of the
evening, although I myself am not at all in sympathy with the
subject about which—which—about which he—"
Aunt Georgy had a second of agony. Could he avoid using the verb
"to speak"? It seemed impossible; but she underrated his mental
agility.
"—about which he is to make his interesting and instructive
address." Mr. Gordon pulled down his waistcoat with a slight gesture
of triumph. "The church," he continued, "has never been in very
cordial sympathy with what I may be permitted, perhaps, to call
these lay miracle workers."
Here he threw a smile over his shoulder to Lisburn—a smile intended
to be friendly and reassuring; but as it had in it something acid and
scornful, it only served to make his words more hostile. "The church
endures," he went on, "and watches in each generation the rise and
fall of a new science, a new philosophy, a new panacea, a new
popular fad like this one."
Having done what he could to discredit the lecture, he gave the
lecturer himself a flattering sentence: "A professor in one of our
great universities, a new resident in this community, and my very
good friend, Mr. Kenneth Lisburn."
The Reverend Mr. Gordon had been standing between Aunt Georgy
and the speaker, so that she did not really get a good look at him
until he stood up.
Then she said "Mercy!" in a hissing whisper in Evie's ear.
"Mercy what?" asked little Evie, rather coldly.
"So good-looking!" murmured Aunt Georgy.
Evie moved her shoulders about.
"Roughhewn," she whispered back.
Perhaps his features were a trifle rugged; but Aunt Georgy admired
his hair—black as a crow under the bright though sometimes
intermittent light of the Jefferson Light and Power Company. His
eyes—black also—gleamed from deep sockets—"Like a rat's in a
cave," Evie said. Lecturing was evidently nothing of an adventure to
him. It did not embarrass him as it had embarrassed the mayor; it
did not stimulate him to an eloquence too suave and fluent as it did
Mr. Gordon. It created not the least change in his personality. He
stood on the platform as he swung in his chair in his college room,
ready to say what he had to say as simply and as clearly as he
could.
He wasn't so sure, he began, that his subject was popular. He found
most people enjoyed the exploration of other people's unconscious,
not of their own. In fact you could generally tell whether you were
right in a diagnosis or not by the passion with which the victim
contradicted you and the rapidity with which he invented
explanations other than the true one. He was not, however, going to
talk about psychoanalysis in general—rather too large a subject—
with its relations to art and medicine. He was going to talk about the
simple, commonplace actions of everyday life as clews to the
unconscious—first, the so-called trivial ones. Nothing is really trivial.
The tunes we whistle, the songs we sing, nine times out of ten have
a wish-thought behind them. An amusing case of this had come to
him the other day. A man had consulted him because he was being
driven mad by a tune that ran in his head night and day. It was the
Funeral March of a Marionette. Well, when it turned out that he was
unhappily married and that his wife's name was Dolly it wasn't very
hard to see whose funeral it was that he was mentally staging.
Aunt Georgy was perfectly delighted. She saw that psychoanalysis
was going to make life in Jefferson infinitely more entertaining. The
sphere of gossip was so remarkably extended. In old times one
could only talk about what had been done, said or written; but now
what was dreamed, what was desired, and, best of all, what was
entirely omitted could be made as interesting as a crime. She
wriggled down into her chair with pleasure as he went on to take up
the question of the types that people fell in love with. Of course, we
have all noticed how people tend to fall in love again and again with
the same type. The spoiled weak son is forever looking for a mother
type to take care of him; the girl brought up under the domination of
the father idea is attracted by nothing but protective older types of
men.
Lisburn went on to describe such cases in greater detail so
accurately that all through the audience married couples were
nodding to one another and themselves. He described also a variant
of this: How some people always abused the type that attracted
them most; the virile man who is forever making fun of feminine
weaknesses, the womanly woman always taking on about man's
wickedness; they're afraid of the black magic they attack; they are
trying to exorcise the spell—
As soon as the lecture was over, and while eager members of the
audience were crowding to the platform to discuss with the speaker
the cases of mysterious friends who had dreamed this and forgotten
that, Aunt Georgy beckoned to Norma.
"Do," she said, "go and disentangle that interesting young man from
his votaries, or whatever they are, and bring him down to be
introduced to me."
"It was interesting, wasn't it?" said Norma, with an effort at
detachment.
"I can never be sufficiently grateful," answered Aunt Georgy. "It is so
satisfactory the way he lays the strictly virtuous open to attack—the
sort of people we've wanted to catch in a scandal and never been
able to."
Norma nodded.
"Oh, yes," she said, "Ken thinks people like that have a very foul
unconscious."
Aunt Georgy gave a slight snort and asked Norma if she
remembered the Bab Ballad about:
For only scoundrels dare to do
What we consider just and true;
And only good men do in fact,
What we should think a dirty act.

But Norma did not enjoy a humorous approach to a subject which


she had only recently made her own. She withdrew; frowning
slightly, and saying that she would try to get a word with him.
"Oh, don't let's wait," said Evie after a few minutes, during which the
crowd on the platform increased.
And so Aunt Georgy was led home by the mayor and her small niece
without getting a word with the speaker. But she was a determined
woman; and though Lisburn was a busy man, between lecturing at
his college in the daytime and conferences with mentally
maladjusted in Jefferson in the evening and giving a good many
spare hours to Norma, a free afternoon was finally found and Norma
brought him to tea. Little Evie, who happened to be spending a
week or two with her aunt, immediately announced her intention of
being out.
"I don't like that man," she said.
Aunt Georgy, always eager for information, inquired why she didn't.
Evie thought a long time, and then said, "Because he invades one's
private life."
"Does Norma feel that way?"
Little Evie laughed. "Norma hasn't got a private life," she answered.
At five o'clock, when Aunt Georgy was settled on her blue sofa, with
her cane beside her and her tea set in front, Evie stole quietly out of
the back door into the garden as Norma and the seer entered at the
front.
"Well, here he is, Aunt Georgy," Norma shouted from the threshold,
as if she had done a good deal for an elderly relation.
He came in and shook hands, unruffled by Norma's introduction.
"Where's Evie?" Norma went on in a tone rather like a sheriff's
officer.
"She was so sorry—she had an engagement," said Aunt Georgy,
quite as if it were true.
Norma gave a short shout.
"Oh, Ken knows she doesn't like him," she said; "and as a matter of
fact, he isn't very keen about her."
Lisburn looked at Miss Hadley, not exactly embarrassed, but as if to
say that when you told a thing to Norma you told it to the whole
world. Aunt Georgy was interested in his not denying the accusation.
She had never before happened to meet a man who actually did not
like Evie.
"You don't admire my little niece?" she said, in her tone of seeking
information merely.
"No," shouted Norma from the hearthrug. "He thinks she's too
colorless, too much tied up with inhibitions to be interesting."
"Of course, I see your niece's great charm," he answered; "but, as I
said the other night, we all have our own type—the type that
particularly appeals—and I am attracted to a more active, aggressive
type."
"That's why he likes me," said Norma, with her mouth not empty of
chocolate cake—"because I lead a great, free, ramping life. Isn't that
true, Ken?"
"I'm sure it's true you lead a great, free, ramping life, Norma," said
her aunt.
"Yes, and that's why I'm so healthy," answered Norma, and she
danced a little on her flat-heeled shoes. They were large shoes, but
then, she was a large woman.
Aunt Georgy was surprised to find herself a partisan. It annoyed her
to hear her favorite niece dismissed as attractive to other men but
not to this reader of human hearts.
She said almost pettishly, "Evie is healthy, too—one of the healthiest
people I ever knew."
"I bet she has dreams," said Norma.
"I doubt it."
"Everybody dreams, Aunt Georgy," said Norma, really astonished at
her aunt's ignorance of the facts of life. "If you don't remember your
dreams, that only shows that they are so awful that you don't allow
them to come up into your conscious at all."
Aunt Georgy was opening her mouth to contradict, but found that
Lisburn was speaking.
"That's the theory, Miss Hadley," he said, less positively than Norma;
"that everyone dreams, and that our dreams represent our
unfulfilled and unacknowledged desires. A type like—like Miss—"
"Like Evie," said Norma, a foe to last names.
"That type," Lisburn went on—"so restrained, so inhibited, so what is
called well-bred, is particularly likely to have dreams and almost
certain to be unwilling to admit having them."
He stopped as a slight sound at the door that led to the garden
made them all turn. Little Evie was standing there—had evidently
been standing there for some time. She had on a sky-blue dress, a
large childish hat and her arms were full of cherry blossoms. She
looked more than usually like a fashion plate of the '40's.
Norma immediately shouted at her, "You do dream, don't you, Evie?
Be honest for once in your life."
Aunt Georgy, who was herself an honest person, was aware of an
utterly unsuppressed wish that, whatever the facts were, Evie would
say that she had never had a dream in her life. Instead the girl, with
her blue eyes fixed on Lisburn, was nodding slowly.
"I've begun to dream lately," she said in a low tone.
Norma was delighted.
"I knew it," she said. "I'd have bet on it. It's extraordinary how one
gets to know these things. Tell us what your dream is about, Evie."
"Mercy!" exclaimed Aunt Georgy. "Isn't a person allowed more than
one dream nowadays?"
Evie sank down on the sofa at her aunt's feet.
"Mine's always the same," she murmured.
"Ah," said Lisburn, "a recurrent dream." He looked at her with
interest. "Does it trouble you?"
Evie made a cooing sound like a dove, in doubt. Norma began to
tease her to tell. Aunt Georgy thought she was tiresome, nagging
and bothering like that. She told her to let Evie alone. Norma
shrugged her shoulders.
"It's so characteristic of that introverted type," she said, "not to be
willing to be frank enough to be cured."
"Can one be cured?" asked Evie, and she raised her eyes to Lisburn.
He was a busy man, and he had stood up to go.
"I might—if it troubles you—be able to help you."
"Even," said Evie, "though you are not interested in my type?"
"Oh," cried Norma, "isn't that like you, Evie! You overheard the
whole thing, and instead of having it out then and there, as I should
have, you wait and give him a poisoned dig in the ribs when he's
trying to be nice to you."
Evie repeated in exactly the same tone: "Even though you are not
interested in my type?"
"I'm always interested in a case," he answered.
They exchanged unfriendly looks. Then he came to the sofa to say
good-by to Aunt Georgy. She was rummaging for a pencil among the
litter of papers and books beside her. She wanted to write down the
name of his book, but he insisted very civilly on sending it to her.
When he and Norma had gone Aunt Georgy turned to Evie.
"I'm glad," she said, "that you did not tell them what your dream
was about. They would have been sure to make something horrid
out of it."
"I couldn't tell them."
"You mean it is horrid?"
"I hadn't made it up yet," answered Evie. "Dear Aunt Georgy, I
never, never dream. I'm always asleep before I get the covers well
tucked in at the nape of my neck, and I never wake up until
someone comes in and opens the shutters. Norma was so
determined that I should have a dream—perhaps she won't be so
pleased. Mine is going to be a hard one to interpret. Interested in
cases, is he? Well, mine is going to be an interesting one. Wait till
we get his book."
The book was left at the door after dinner, and Aunt Georgy plunged
at once into it. She habitually read as a famished animal eats,
tearing the heart out of a book, utterly oblivious of the world until
she had finished. At last she looked up.
"Really, Evie," she exclaimed, "I'm afraid you can't get a dream out
of this. I'm not old-fashioned, but I must say—" She did not say
what it was she must say.
Evie took the book calmly.
"Of course, I shall be perfectly innocent as to what my dream
means, Aunt Georgy," she said. "Let's see. X, a young employe in a
shoe factory, dreamed— My goodness, what an unpleasant man X
must have been! Now this isn't bad— Or, no, that would involve
mother. I don't want to drag poor mother into it. Something
wonderful might be done with a tune—Old Black Joe, if only his
name were Joe, which it isn't.... And I shall begin to do a strange
and apparently meaningless thing—to have a compulsion. I mean—
like buttering my bread on both sides—"
"Don't you think it's a little dangerous?" said Aunt Georgy. "They
interpret everything so oddly."
"Yes, it's dangerous; but everything is. If you do nothing, that's the
worst of all." And Evie sank into the book.
A few days later, when Lisburn reached home in the late afternoon,
he found a note waiting for him at his house. It was written in Evie's
neat, fine hand, and said:

Dear Mr. Lisburn: Do you remember offering to help me in case


the dream—of which I think I spoke to you—began to give me
trouble? I must say I hesitate to take up your time, as the whole
thing seems so trivial [Lisburn gave a little shake of his head, an
indication that such experiences were far from trivial] but it
would be a relief to me to talk it over with you, and I shall stop
at your house for a few minutes this evening on the chance that
you may have a spare minute.

He laid the letter on the table and eyed it sideways as he lit his pipe.
Then he went to the telephone and called up Norma. He said he was
sorry, but that he wouldn't be able to come that evening for bridge.
Norma, as she herself had observed, did not suffer from inhibitions.
Her emotions found easy expression, and her emotion on this
occasion was disappointment mingled with anger. She expressed it
freely over the telephone. Lisburn hung up the receiver sharply. Self-
expression was all very well, he thought; but there was such a thing
as having no self-control. It was necessary for him to have a calm
and receptive mind in order to be of any assistance to this child who
was coming to consult him. He must make a mental picture of her
personality and recall her gestures, her vocabulary.
Soon after eight he heard her step on the piazza and went to the
door himself. She entered with that timid, conscious, apologetic
manner which had become so familiar to him in his patients. It
seemed as if she would have liked to make fun of herself for coming
if only she had been less frightened at finding herself there. The
hand she gave him shook. He drew forward a deep comfortable
chair for her.
"Now tell me everything you can think of," he said; "your own way; I
won't interrupt."
She drew an uncertain breath.
"Well, I didn't think anything about it—you know how casually I
spoke the other day—but now I find it is beginning to affect my
conduct. I find I cannot bring myself to get into an automobile. I
have never driven a car myself, but I have always enjoyed driving
with other people; but now— This dream of mine is about a car."
She described the dream at great length, though it was strangely
lacking in incident. It was merely that she was driving a small car of
her own—a very pretty white car with a good deal of blue about it.
She was driving along a wide street, and suddenly the car began to
skid, slowly at first and then faster and faster; and though her agony
became extreme and she turned the steering wheel more and more,
she could do nothing—the car made straight for the bushes, where
some terrific but unseen and unknown object was lurking.
He made her go over the details of it two or three times. The shade
of blue was about the same shade as the dress she was wearing,
but he elicited very little more. She could not, she said, get any clew
as to what was hidden in the bushes, except that it was something
she was horribly afraid of.
"And yet," he said, "you go toward it?"
"Yes; but entirely against my will, Mr. Lisburn."
"You're sure you go against your will?"
Her voice was almost hysterical as she protested, "Yes—yes,
indeed!"
"And yet you go?"
"No, Mr. Lisburn, the car goes."
"Don't you think you and the car are the same?"
She gave him a long wondering stare, and presently insisted that
she must go. She promised, however, that she would do everything
in her power to find out what was hidden in those sinister bushes.
She was to keep a pencil and paper beside her bed and write down
everything she could remember as soon as she waked up in the
morning.
She hurried home to tell Aunt Georgy all that had occurred and was
disappointed to find her aunt established at the bridge table with
Norma and two of Norma's friends. It seemed that Mr. Lisburn had
been expected as a fourth and they had been obliged to come to
Aunt Georgy at the last minute to make up the table. Norma was still
angry.
"They can't have it both ways—these psychoanalysts," Norma was
saying. "It's always a Freudian forgetting—a wish-thought—when
you forget an engagement with them, and something quite
professional and unavoidable when they break an engagement with
you."
"What Norma means, Evie," said Aunt Georgy, without raising her
eyes from the interesting hand which had just been dealt her, "is
that she suspects Mr. Lisburn of having had something more
amusing to do."
Evie shook her head as if you couldn't be sure with men like that.
"Perhaps he had," she said.
Then Aunt Georgy knew the interview had gone well.
Three days later, not having heard anything more from her, he came
to the house late in the afternoon. He was in his own car, and he
suggested that perhaps he could help her to overcome her
repugnance to motoring. At first she refused with every appearance
of terror; but soon she admitted that with him she would feel
perfectly safe, and so she yielded and got in.
She spoke little, and he could hear that she drew her breath in a
tremulous and disturbing manner. At last, in a lonely road, her terror
seemed to overmaster her, and she opened the door and would have
sprung out while the car was going thirty-five miles an hour if
Lisburn had not held her in.
As soon as he had brought the car to a standstill he took his arm
away, while little Evie cowered in the seat beside him.
"You see," she said at last, "how it is with me? If you had not been
there I should have jumped out and been killed. It's stronger than I
am."
"I see," he answered gently. "Well, if it happens again I won't force
you to stay in the car. You shall get out and walk home."
She thanked him warmly for his concession, but it did not happen
again.
After this they had conferences every evening, as her stay at
Jefferson was coming to an end, and she still did not seem to be
able to see what was the emotional center of her dream.
The fact that Lisburn was trying to help little Evie soon began to be
known, and the knowledge affected different people differently.
Norma said that she should think Evie would be ashamed to take up
so much of Mr. Lisburn's time, considering how contemptuous she
had been about the whole science of psychoanalysis. The Reverend
Mr. Gordon said that he had never been in any doubt that the human
spirit needed the confessional, but that only a man in holy orders
was fit to receive confession. The mayor was a little more violent. He
said that it appeared to him that this fellow was practicing medicine
without a license, and that if the law could not reach him it ought to
be able to. He hoped it wasn't doing little Miss Evie any harm. Aunt
Georgy tried to reassure him, and said Evie seemed in the best of
health and spirits, at which the mayor, looking gloomier than ever,
said he was much relieved. Aunt Georgy had just been telling this to
Evie as she was about to start for her last conference. She was
going away the next day.
"Have you decided what it is that is hidden in the bushes?" her aunt
asked her.
Evie nodded.
"Yes," she said; "it's a black panther—a beautiful, lithe, vigorous,
graceful, dangerous wild animal."
"Mercy!" exclaimed Aunt Georgy. "He'll think it's himself."
"Do you think he's a vain man, Aunt Georgy?"
"Everyone's as vain as that."
"Well, that isn't my fault," said Evie, and went on her way.
Aunt Georgy shook her head. Life was often like that, she thought—
a woman despised a man for believing something that she had
exercised all her ingenuity to make him believe.
Lisburn was on his feet when Evie entered, and as soon as he had
seen her settled in the deep chair he began to pace up and down;
like a panther, she thought, but did not say so; that would have
been crude.
"Well," he said, fixing his black eyes on her, "you've found out what
it is, haven't you?"
She nodded.
"You are clever," she answered. "I don't know what you'll make of it
—it sounds so silly." She looked up at him, rubbing the back of one
hand against the palm of the other. "It's—it's a panther; just a
beautiful black panther; a splendid, lithe, graceful, dangerous wild
animal." Even little Evie was susceptible at times to embarrassment,
and at this moment she could not endure the piercing stare of those
black eyes. She dropped her eyes modestly and murmured, "Oh, Mr.
Lisburn, do you think you can help me?"
"I'm sure I can," he answered; "at least, I can if I may be perfectly
candid."
Evie said that was all she asked—candor.
"In that case—" said he. He walked to the door and leaned against it
as if the revelations he was about to make were such that she might
try to escape before she heard him out. "In that case," he repeated,
in that smooth, almost honeyed tone in which the psychoanalyst
clothes even the most shocking statements, "let me say that you are
the most phenomenal little liar, little Evie, that I have ever met—yes,
among all the many I have known I gladly hand you the palm."
"Mr. Lisburn!" said Evie, but she was so much surprised and
interested that she did not do justice to her protest.
"What makes me angry," he went on in his civil tone, "is that you
should imagine you could get away with it. However much of an ass
you may consider me, you ought to have known that there was
enough in the science of psychoanalysis to show from the very
beginning that you were a fraud."
"Not from the beginning!" said Evie.
"From the first evening. You haven't one single symptom of a person
with a neurosis—not one. If you knew a little bit more—pooh, if you
knew anything at all about the subject—"
"I read your book," she answered, as if this put the blame on him.
"Not very intelligently, then, or you would have done a better fraud."
"You were willing to waste a lot of time on a fraud."
"It hasn't been wasted. And that brings me to my second point. I will
now tell you what perhaps you don't know, and that is why you did
it."
"I know perfectly well, thank you," replied Evie. "I did it because you
were so poisonous about me that afternoon at Aunt Georgy's. I
thought I'd like to show you—"
"That is a rationalization," he interrupted, waving it away with one
hand. "You did it because you are strongly attracted to me."
"Attracted to you!" said Evie in a most offensive tone.
"I am the panther in the bushes."
Evie laughed contemptuously.
"I knew you'd think you were the panther," she said; "I simply knew
it."
"Of course you did," he answered. "That's the very reason you
dreamed it."
"But I didn't dream it," she returned triumphantly. "I thought you
had grasped that. I didn't dream it. I never dream."
He was not triumphed over.
"Well," he said, "you made it up; that's the same thing—a daydream,
a romance."
"I made it up particularly in order to deceive you," Evie explained.
"That's what you think," he answered; "but it isn't true. You made it
up in order to let me know you were attracted to me, for I repeat
that you are attracted to me."
Little Evie sprang up from the deep chair in which she had sat at
ease during so many evening conferences.
"You may repeat it until you are black in the face," she said; "but I'm
not, I'm not, I'm not!"
"Don't you see that the emotion with which you repudiate the idea
proves that it's the truth?"
An inspiration came to her.
"Then why," she demanded—"the other afternoon when you
explained so much why you didn't like me—why doesn't that prove
that you are attracted to me?"
"Little Evie," he said, "it does. That's the truth. You are almost
everything of which I disapprove in woman. I love you."
He approached and took her in his arms.
"I hate you," said Evie, in a tone too conversational to be
impressive.
He behaved as if she had not spoken. She drew away from him,
though not wholly out of the circle of his arms.
"I don't think you can have understood me," she remarked coldly. "I
said I hated you."
"I feel more sure of you than if you had said you loved me."
"Then I'll say I love you."
"Yes, dear, I know you do."
She sighed.
"You're not a very consistent man, are you?" she said.
She spoke in a tone of remote philosophy, but she leaned her
forehead against his chest.
When the story came out, as of course it was bound to do—for both
Evie and Lisburn seemed to think they had been rather clever about
the whole thing, and they told everybody—Fanny was deeply
shocked. In fact, she owned that if she had been Evie's mother she
would never have held up her head again.
"To think," she said, "of Evie, who has always seemed so dignified
and well-bred and not of this generation at all—to think that she
invented the whole thing in order to attract Mr. Lisburn's attention!"
"Fanny," said Aunt Georgy, "do you remember the first day you met
your present husband? You twisted your ankle just so that he might
have to carry you upstairs to your room. Well, my dear, you
recovered entirely as soon as he had gone, and walked all over
everywhere. A strange young man carried you in his arms, Fanny. If
you ask me, I call the new technique more delicate and modest than
the old."
THE NEW STOICS
Mr. Brougham stood waiting in the wings. Never before had he made
a speech; never had he been upon a stage, except to sit safely with
a delegation, in a row, behind the ice-water pitcher. He had a small
dry patch in his throat which constant swallowing failed to improve,
and the tips of his fingers kept getting cold and very distant. He was
about to make a Liberty Loan speech, and he was suffering more
than he had expected; but, as he kept murmuring to himself, "Dulce
et decorum est."
At twenty-eight he had volunteered among the first in the Spanish
War, and it had been no fault of his that he had never got any
nearer the front than Chattanooga. At forty-eight he could still speak
for his country—at least he hoped he could. How absurd to be
nervous! This was no time to be thinking of one's own feelings. He
took out his handkerchief and wiped the palms of his hands. "Well,
Mr. Brougham," said the loud bold voice of the local chairman, "shall
we go on?" What was one victim more or less to him in his insatiable
campaign for speakers?
"By all means," answered Brougham in a tone which even in his own
ears sounded like that of a total stranger.
His only conscious thought was grateful remembrance that his wife
was kept at the canteen that evening, and couldn't be in the
audience, which he found himself regarding as a hostile body
waiting to devour him. He sat trying to relax the muscles of his face
during the chairman's short address; and then the fatal sentence
began: " ... the great pleasure ... introduce ... so well known ... Mr.
Walter Brougham, who will say a few rousing words to you on this
great subject."
What a silly adjective "rousing" was, Brougham thought as he came
forward. He had no intention whatever of being rousing. He
wondered if he had the intention of being anything except absolutely
silent. He lifted the lid and looked into his mind as into an
unexplored box. Was there anything in it? Why, yes; rather to his
surprise he found there was.
"My friends," he began, "this is no time for oratory." Hearty, and to
Brougham totally unexpected, applause greeted this sentiment. "This
is a time for cool, steady, clear-eyed vision." That was a mistake; of
course vision was clear-eyed. "This is a time to ask ourselves this
question: How is it that we hesitate to give our money, and yet
stand ready—every one of us—to give our lives and—harder still—
our sons' lives?"
"Hear, hear!" cried a voice from the audience, fresh, young and
familiar. Brougham looked down; yes, there they were—his own two
boys, David, not eighteen, and Lawrence, hardly fifteen. Their blond,
well-brushed heads towered above the rest of the row and were
easily recognizable. He could see the expressions of their faces—
cool, serene, friendly approval. They're too damned philosophical, he
said to himself; and as he went on speaking, with all that was mortal
in him concentrated on his words, in some entirely different part of
his being a veil was suddenly lifted and he saw something that he
had been trying not to see for months—namely, that he was
dissatisfied with his elder son's attitude toward the war—it was cool;
cool like his approval of the speech. Not that Mr. Brougham wanted
his son to volunteer at his age—quite the contrary; he sincerely
believed it was every man's duty to wait until he had reached the
age designated by his country; but he did want the boy to want to
volunteer. He wanted to be able to say at the club as other fathers
were saying: "What gets into these young fellows? I've had to forbid
my boy—" Perhaps if his self-vision had been perfect he would have
admitted that he had sometimes said it.
And then it occurred to him that this was the moment to stir their
hearts—to make one of those speeches which might not touch the
audience but which would inflame the patriotism of youth. Forgetting
his recent pledge he plunged into oratory—the inherited oratory of
the Fourth of July, he snatched up any adjectives as long as they
came in threes, called patriotism by name, and spoke of the flag as
Old Glory. Hurried on by his own warmth he reached his climax too
soon, ended his speech before the audience expected and began
asking for subscriptions before anyone was ready.
There was an awkward silence. Then a young voice spoke up: "One
one-hundred-dollar bond." Yes, it was David. Mr. Brougham's heart
leaped with hope; had the boy been moved? Was this the first fruit
of repentance? He looked down, hoping to meet the upward glance
of a devotee, but David was whispering something to his younger
brother which made the latter giggle foolishly.
The ball once set rolling went fast. Subscriptions poured in; it was a
successful evening—almost as successful as the evening made
famous by a great screen artist. Mr. Brougham was warmly
congratulated by the local chairman.
"We shall call on you again, Brougham," he said gayly.
Mr. Brougham nodded, but his thought was: Is nothing enough for
these fellows?
His two boys were waiting for him at the stage door. "You're good,
sir, you're good!" they cried, patting him on the back.
"I never thought he'd let them have it so mild," said Lawrence.
Mr. Brougham did not mind being laughed at—at least he always
said he didn't—but he couldn't bear to have patriotism in any form
held up to ridicule. He thought to himself:
"They don't know what it costs a man of my age to go on a stage
and make a speech. I don't enjoy making myself conspicuous."
"We'll stop and get your mother at the canteen," he said sternly.
"Oh, yes, this is mother's night for saving the country, isn't it?" said
Lawrence.
"Did you know," said David to his brother, across his father's head,
for they were both taller than he, "did you know that a gob tipped
mother the other evening? So pleased with his coffee that he flicked
her a dime for herself."
"Oh, you sailor-boys!" said Lawrence in a high falsetto.
This was really more than Mr. Brougham could bear in his exalted
state. "I don't like that, boys," he said.
"No, father," answered David; "but you know we never tipped
mother; in fact, it's always been quite the other way."
"I mean I don't like your tone of ridicule, of—of—of—" He couldn't
think of the word he wanted, and felt conscious that David had it on
the tip of his tongue but was too tactful to interrupt. "You boys don't
seem to appreciate the sacrifice, the physical strain for a woman of
your mother's age—standing all evening handing out sandwiches—
not accustomed to hard work either."
Both boys looked gravely ahead of them, and Mr. Brougham had a
sickening conviction they were both trying to think of something to
say that would calm him.
The canteen was just closing, and the two boys made themselves
useful in putting things away. "Just as if it were a school picnic,"
their father thought.
As soon as they were on their way home Mrs. Brougham asked
about the speech. Had it gone well?
"Oh, father was great, mother," David answered. "He took it from
them in wads, and presented Lawrence and me to his country with
every bond."
"A lady behind us was awfully affected," said Lawrence. "She kept
whispering that she understood the speaker had two lovely boys of
his own."
"I could hardly keep Lawrence from telling her that she had not
been misinformed."
Mr. Brougham sighed. This was not the tone of young men suddenly
roused to a new vision of patriotism. He said aloud: "I was glad you
felt financially able to take a bond yourself, David."
"Oh, yes," answered his son. "I sold my boat yesterday."
Mr. Brougham was not so Spartan a parent that he did not feel a
pang to think of the boy without his favorite pastime on this perhaps
his last summer.
"Quite right," he said. "This is no year for pleasure boats."
"You get a good price for boats this year," said David.
There it was again—that note Mr. Brougham didn't like. Even if
David's motives had been financial and not patriotic he might have
allowed Lawrence to see an example of self-sacrifice. Instead
Lawrence was getting just like his brother.
Brougham was not a man who habitually eased his burdens by
casting them on his wife, but that night when they went upstairs he
took her into his confidence.
"Are you satisfied with David's attitude toward the war?" he began.
She was a silent, deep woman whose actions always astonished
those who had no intuitive knowledge of the great general trends of
her nature. She and David usually understood each other fairly well.
Now she shook her head. "No," she said.
"Good Lord!" said poor Mr. Brougham. "I don't want the boy shot in
a trench. I think it's his duty to wait a year or two; but I can't see
that he has any enthusiasm, any eagerness, hardly any interest. He
seized the paper last evening, and I supposed that he wanted to
read about the offensive. Not at all! After a glance at the headlines
he turned to the baseball news. Do you understand him?"
"No," said his mother.
"At his age I should have been in this war, with or without my
parents' consent. Mind you, I don't want him in it—not for a year or
two. But why doesn't he want to get in? He's not a coward."
"No," said his mother, and then she added: "I've thought a great
deal about it, and I think it's because he's so young—so immature."
"Immature!" cried Mr. Brougham. "Why, he's always using words I
don't know the meaning of!"
"Perhaps he doesn't either," said his wife. "That's immature, isn't it?
But I meant the immaturity of not seeing responsibilities—not taking
them up, at least. You see, my dear, he's very young—only a year
out of school. It's natural enough."
"It's not natural at all," answered Mr. Brougham. "Just out of school
—school is the very place to learn patriotism—drilling and all that—
and I'm sure Granby is one of the most patriotic men I ever knew.
He inspires most of his boys. No, I don't understand. I shall speak to
David about his attitude."
"Oh, don't! You'll have him enlisting to-morrow."
"No; for I shall explain to him that he must wait."
She smiled. "You're going to stir him up to want to do something
which you won't allow him to do. Is that sensible, dear?"
It wasn't sensible, but—more important—it was inevitable. Mr.
Brougham, feeling as he did, could not be silent. He had always
been proud of his boys, had always assumed they were stuff to be
proud of. They had done decently in their lessons, well in their
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebooknice.com

You might also like