0% found this document useful (0 votes)
13 views56 pages

Applications Using Python Chatbots and Face Object and Speech Recognition With Tensorflow and Keras 18707172

The document provides information about various ebooks available for download on ebooknice.com, including titles related to deep learning, cooking, and SAT preparation. It highlights the ebook 'Deep Learning with Applications Using Python' by Navin Kumar Manaswi, which covers topics such as TensorFlow, Keras, and various neural network architectures. The document also includes details on ISBN numbers and links for purchasing or downloading the ebooks.

Uploaded by

saymaladasyl
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views56 pages

Applications Using Python Chatbots and Face Object and Speech Recognition With Tensorflow and Keras 18707172

The document provides information about various ebooks available for download on ebooknice.com, including titles related to deep learning, cooking, and SAT preparation. It highlights the ebook 'Deep Learning with Applications Using Python' by Navin Kumar Manaswi, which covers topics such as TensorFlow, Keras, and various neural network architectures. The document also includes details on ISBN numbers and links for purchasing or downloading the ebooks.

Uploaded by

saymaladasyl
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 56

Download the Full Ebook and Access More Features - ebooknice.

com

(Ebook) Deep Learning with Applications Using


Python Chatbots and Face, Object, and Speech
Recognition With TensorFlow and Keras by
SpringerLink (Online service); Manaswi, Navin
Kumar ISBN 9781484235157, 9781484235164,
https://ebooknice.com/product/deep-learning-with-
1484235150, 1484235169
applications-using-python-chatbots-and-face-object-and-
speech-recognition-with-tensorflow-and-keras-18707172

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) Biota Grow 2C gather 2C cook by Loucas, Jason; Viles, James ISBN
9781459699816, 9781743365571, 9781925268492, 1459699815, 1743365578, 1925268497

https://ebooknice.com/product/biota-grow-2c-gather-2c-cook-6661374

ebooknice.com

(Ebook) SAT II Success MATH 1C and 2C 2002 (Peterson's SAT II Success) by Peterson's
ISBN 9780768906677, 0768906679

https://ebooknice.com/product/sat-ii-success-math-1c-and-2c-2002-peterson-s-sat-
ii-success-1722018

ebooknice.com

(Ebook) Matematik 5000+ Kurs 2c Lärobok by Lena Alfredsson, Hans Heikne, Sanna
Bodemyr ISBN 9789127456600, 9127456609

https://ebooknice.com/product/matematik-5000-kurs-2c-larobok-23848312

ebooknice.com

(Ebook) Master SAT II Math 1c and 2c 4th ed (Arco Master the SAT Subject Test: Math
Levels 1 & 2) by Arco ISBN 9780768923049, 0768923042

https://ebooknice.com/product/master-sat-ii-math-1c-and-2c-4th-ed-arco-master-
the-sat-subject-test-math-levels-1-2-2326094

ebooknice.com
(Ebook) Cambridge IGCSE and O Level History Workbook 2C - Depth Study: the United
States, 1919-41 2nd Edition by Benjamin Harrison ISBN 9781398375147, 9781398375048,
1398375144, 1398375047

https://ebooknice.com/product/cambridge-igcse-and-o-level-history-
workbook-2c-depth-study-the-united-states-1919-41-2nd-edition-53538044

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 Projects Using TensorFlow 2: Neural Network Development with
Python and Keras by Vinita Silaparasetty ISBN 9781484258019, 1484258010

https://ebooknice.com/product/deep-learning-projects-using-tensorflow-2-neural-
network-development-with-python-and-keras-11300868

ebooknice.com

(Ebook) Deep Learning for Computer Vision - Image Classification, Object Detection
and Face Recognition in Python by Jason Brownlee

https://ebooknice.com/product/deep-learning-for-computer-vision-image-
classification-object-detection-and-face-recognition-in-python-33715580

ebooknice.com

(Ebook) Reinforcement Learning: With Open AI, TensorFlow and Keras Using Python by
Abhishek Nandy; Manisha Biswas ISBN 9781484232842, 9781484232859, 1484232844,
1484232852

https://ebooknice.com/product/reinforcement-learning-with-open-ai-tensorflow-
and-keras-using-python-6840600

ebooknice.com
Deep Learning
with Applications
Using Python
Chatbots and Face, Object, and Speech
Recognition With TensorFlow and Keras

Navin Kumar Manaswi
Foreword by Tarry Singh
Deep Learning with
Applications Using
Python
Chatbots and Face, Object,
and Speech Recognition
With TensorFlow and Keras

Navin Kumar Manaswi


Foreword by Tarry Singh
Deep Learning with Applications Using Python
Navin Kumar Manaswi
Bangalore, Karnataka, India

ISBN-13 (pbk): 978-1-4842-3515-7 ISBN-13 (electronic): 978-1-4842-3516-4


https://doi.org/10.1007/978-1-4842-3516-4
Library of Congress Control Number: 2018938097

Copyright © 2018 by Navin Kumar Manaswi


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: Matthew Moodie
Coordinating Editor: Divya Modi
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 [email protected], or visit www.springeronline.com. Apress Media, LLC is a
California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc
(SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
For information on translations, please e-mail [email protected], 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 author in this book is
available to readers on GitHub via the book’s product page, located at www.apress.
com/9781484235157. For more detailed information, please visit www.apress.com/source-code.
Printed on acid-free paper
Table of Contents
Foreword by Tarry Singh���������������������������������������������������������������������ix

About the Author�������������������������������������������������������������������������������xiii


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

Chapter 1: Basics of TensorFlow����������������������������������������������������������1


Tensors������������������������������������������������������������������������������������������������������������������2
Computational Graph and Session������������������������������������������������������������������������3
Constants, Placeholders, and Variables����������������������������������������������������������������6
Placeholders���������������������������������������������������������������������������������������������������������9
Creating Tensors�������������������������������������������������������������������������������������������������12
Fixed Tensors�������������������������������������������������������������������������������������������������13
Sequence Tensors�����������������������������������������������������������������������������������������14
Random Tensors��������������������������������������������������������������������������������������������15
Working on Matrices�������������������������������������������������������������������������������������������16
Activation Functions��������������������������������������������������������������������������������������������17
Tangent Hyperbolic and Sigmoid�������������������������������������������������������������������18
ReLU and ELU������������������������������������������������������������������������������������������������19
ReLU6������������������������������������������������������������������������������������������������������������20
Loss Functions����������������������������������������������������������������������������������������������������22
Loss Function Examples��������������������������������������������������������������������������������23
Common Loss Functions�������������������������������������������������������������������������������23

iii
Table of Contents

Optimizers�����������������������������������������������������������������������������������������������������������25
Loss Function Examples��������������������������������������������������������������������������������26
Common Optimizers��������������������������������������������������������������������������������������27
Metrics����������������������������������������������������������������������������������������������������������������28
Metrics Examples������������������������������������������������������������������������������������������28
Common Metrics�������������������������������������������������������������������������������������������29

Chapter 2: Understanding and Working with Keras���������������������������31


Major Steps to Deep Learning Models����������������������������������������������������������������32
Load Data������������������������������������������������������������������������������������������������������33
Preprocess the Data��������������������������������������������������������������������������������������33
Define the Model�������������������������������������������������������������������������������������������34
Compile the Model�����������������������������������������������������������������������������������������36
Fit the Model��������������������������������������������������������������������������������������������������37
Evaluate Model����������������������������������������������������������������������������������������������38
Prediction������������������������������������������������������������������������������������������������������38
Save and Reload the Model���������������������������������������������������������������������������39
Optional: Summarize the Model��������������������������������������������������������������������39
Additional Steps to Improve Keras Models���������������������������������������������������������40
Keras with TensorFlow����������������������������������������������������������������������������������������42

Chapter 3: Multilayer Perceptron�������������������������������������������������������45


Artificial Neural Network�������������������������������������������������������������������������������������45
Single-Layer Perceptron�������������������������������������������������������������������������������������47
Multilayer Perceptron������������������������������������������������������������������������������������������47
Logistic Regression Model����������������������������������������������������������������������������������49

iv
Table of Contents

Chapter 4: Regression to MLP in TensorFlow�������������������������������������57


TensorFlow Steps to Build Models����������������������������������������������������������������������57
Linear Regression in TensorFlow������������������������������������������������������������������������58
Logistic Regression Model����������������������������������������������������������������������������������62
Multilayer Perceptron in TensorFlow������������������������������������������������������������������65

Chapter 5: Regression to MLP in Keras����������������������������������������������69


Log-Linear Model������������������������������������������������������������������������������������������������69
Keras Neural Network for Linear Regression������������������������������������������������������71
Logistic Regression���������������������������������������������������������������������������������������������73
scikit-learn for Logistic Regression���������������������������������������������������������������74
Keras Neural Network for Logistic Regression����������������������������������������������74
Fashion MNIST Data: Logistic Regression in Keras���������������������������������������77
MLPs on the Iris Data������������������������������������������������������������������������������������������80
Write the Code�����������������������������������������������������������������������������������������������80
Build a Sequential Keras Model���������������������������������������������������������������������81
MLPs on MNIST Data (Digit Classification)����������������������������������������������������������84
MLPs on Randomly Generated Data��������������������������������������������������������������������88

Chapter 6: Convolutional Neural Networks�����������������������������������������91


Different Layers in a CNN������������������������������������������������������������������������������������91
CNN Architectures�����������������������������������������������������������������������������������������������95

Chapter 7: CNN in TensorFlow������������������������������������������������������������97


Why TensorFlow for CNN Models?����������������������������������������������������������������������97
TensorFlow Code for Building an Image Classifier for MNIST Data��������������������98
Using a High-Level API for Building CNN Models����������������������������������������������104

v
Table of Contents

Chapter 8: CNN in Keras�������������������������������������������������������������������105


Building an Image Classifier for MNIST Data in Keras��������������������������������������105
Define the Network Structure����������������������������������������������������������������������107
Define the Model Architecture���������������������������������������������������������������������108
Building an Image Classifier with CIFAR-10 Data���������������������������������������������110
Define the Network Structure����������������������������������������������������������������������111
Define the Model Architecture��������������������������������������������������������������������������112
Pretrained Models���������������������������������������������������������������������������������������������113

Chapter 9: RNN and LSTM�����������������������������������������������������������������115


The Concept of RNNs����������������������������������������������������������������������������������������115
The Concept of LSTM����������������������������������������������������������������������������������������118
Modes of LSTM�������������������������������������������������������������������������������������������������118
Sequence Prediction�����������������������������������������������������������������������������������������119
Sequence Numeric Prediction���������������������������������������������������������������������120
Sequence Classification������������������������������������������������������������������������������120
Sequence Generation����������������������������������������������������������������������������������121
Sequence-to-Sequence Prediction��������������������������������������������������������������121
Time-Series Forecasting with the LSTM Model������������������������������������������������122

Chapter 10: Speech to Text and Vice Versa��������������������������������������127


Speech-to-Text Conversion�������������������������������������������������������������������������������128
Speech as Data�������������������������������������������������������������������������������������������������128
Speech Features: Mapping Speech to a Matrix������������������������������������������������129
Spectrograms: Mapping Speech to an Image���������������������������������������������������131
Building a Classifier for Speech Recognition Through MFCC Features�������������132
Building a Classifier for Speech Recognition Through a Spectrogram�������������133
Open Source Approaches����������������������������������������������������������������������������������135

vi
Table of Contents

Examples Using Each API����������������������������������������������������������������������������������135


Using PocketSphinx�������������������������������������������������������������������������������������135
Using the Google Speech API�����������������������������������������������������������������������136
Using the Google Cloud Speech API�������������������������������������������������������������137
Using the Wit.ai API�������������������������������������������������������������������������������������137
Using the Houndify API��������������������������������������������������������������������������������138
Using the IBM Speech to Text API����������������������������������������������������������������138
Using the Bing Voice Recognition API����������������������������������������������������������139
Text-to-Speech Conversion�������������������������������������������������������������������������������140
Using pyttsx�������������������������������������������������������������������������������������������������140
Using SAPI���������������������������������������������������������������������������������������������������140
Using SpeechLib������������������������������������������������������������������������������������������140
Audio Cutting Code��������������������������������������������������������������������������������������141
Cognitive Service Providers������������������������������������������������������������������������������142
Microsoft Azure�������������������������������������������������������������������������������������������143
Amazon Cognitive Services�������������������������������������������������������������������������143
IBM Watson Services�����������������������������������������������������������������������������������144
The Future of Speech Analytics������������������������������������������������������������������������144

Chapter 11: Developing Chatbots�����������������������������������������������������145


Why Chatbots?��������������������������������������������������������������������������������������������������146
Designs and Functions of Chatbots������������������������������������������������������������������146
Steps for Building a Chatbot�����������������������������������������������������������������������������147
Preprocessing Text and Messages��������������������������������������������������������������148
Chatbot Development Using APIs����������������������������������������������������������������166
Best Practices of Chatbot Development������������������������������������������������������������169
Know the Potential Users����������������������������������������������������������������������������169
Read the User Sentiments and Make the Bot Emotionally Enriching����������169

vii
Table of Contents

Chapter 12: Face Detection and Recognition������������������������������������171


Face Detection, Face Recognition, and Face Analysis��������������������������������������172
OpenCV�������������������������������������������������������������������������������������������������������������172
Eigenfaces���������������������������������������������������������������������������������������������������173
LBPH������������������������������������������������������������������������������������������������������������175
Fisherfaces��������������������������������������������������������������������������������������������������176
Detecting a Face�����������������������������������������������������������������������������������������������177
Tracking the Face����������������������������������������������������������������������������������������������179
Face Recognition����������������������������������������������������������������������������������������������182
Deep Learning–Based Face Recognition����������������������������������������������������������185
Transfer Learning����������������������������������������������������������������������������������������������188
Why Transfer Learning?�������������������������������������������������������������������������������188
Transfer Learning Example��������������������������������������������������������������������������189
Calculate the Transfer Value������������������������������������������������������������������������191
APIs�������������������������������������������������������������������������������������������������������������������197

Appendix 1: Keras Functions for Image Processing�������������������������201

Appendix 2: Some of the Top Image Data Sets Available�����������������207

Appendix 3: Medical Imaging: DICOM File Format���������������������������211


W
 hy DICOM?�����������������������������������������������������������������������������������������������������211
What Is the DICOM File Format?�����������������������������������������������������������������������211

Index�������������������������������������������������������������������������������������������������213

viii
Foreword by Tarry Singh
Deep Learning has come a really long way.
From the birth of the idea to understand
human mind and the concept of
associationism — how we perceive things
and how relationships of objects and views
influence our thinking and doing, to the
modelling of associationism which started in
the 1870s when Alexander Bain introduced the
first concert of Artificial Neural Networks by grouping the neurons.
Fast forward it to today 2018 and we see how Deep Learning has
dramatically improved and is in all forms of life — from object detection,
speech recognition, machine translation, autonomous vehicles, face
detection and the use of face detection from mundane tasks such as
unlocking your iPhoneX to doing more profound tasks such as crime
detection and prevention.
Convolutional Neural Networks and Recurrent Neural Networks
are shining brightly as they continue to help solve the world problems
in literally all industry areas such as Automotive & Transportation,
Healthcare & Medicine, Retail to name a few. Great progress is being made
in these areas and just metrics like these say enough about the palpability
of the deep learning industry:

–– Number of Computer Science academic papers have soared to almost


10x since 1996

–– VCs are investing 6x more in AI startups since 2000

–– There are 14x more active AI startups since 2000

ix
Foreword by Tarry Singh

–– AI related jobs market is hiring 5x more since 2013 and Deep Learning is
the most sought after skill in 2018

–– 84% of enterprises believe investing in AI will give them a great competi-


tive edge
And finally,

–– the error rate of image classification has dropped from 28% in 2012 to
2.5% in 2017 and it is going down all the time!

Still the research community is not satisfied. We are pushing


boundaries and I am moving ahead with my peers to develop models
around the bright and shiny Capsule Networks and give Deep Learning
a huge edge. I am not the only one in this battle. It is with great pleasure I
put this foreword for Navin, a respected professional in the Deep Learning
community I have come to know so well.
His book is coming just at the right moment. The industry as well as
learners are in need of practical means to strengthen their knowledge in
Deep Learning and apply in their job.
I am convinced that Navin’s book will give the learners what they need.
TensorFlow is increasingly becoming the market leader and Keras too is
being adopted by professionals to solve difficult problems in computer
vision and NLP (Natural Language Processing). There is no single
company on this planet who isn’t investing in these two application areas.
I look forward to this book being published and will be the first in line
to get it. And my advice to you is: you should too!
—Tarry Singh

x
Foreword by Tarry Singh

About Tarry Singh


Tarry Singh is the Founder and AI Neuroscience Researcher
@deepkapha.ai | Mentor DeepLearning @Coursera. A thought-leader,
entrepreneur, and SME with deep industry knowledge in deep learning,
machine learning, artificial intelligence. Internationally acknowledged
speaker, author, and mentor and startup coach. An organizationally
sensitive advisor with a deep understanding of both subjective and
objective challenges within the organization; His goal is to help improve
the individual and organizational performance of his clients by supporting
in transformational change management programs specifically
digital/data analytics transformation.

xi
About the Author
Navin Kumar Manaswi has been developing
AI solutions with the use of cutting-­edge
technologies and sciences related to artificial
intelligence for many years. Having worked for
consulting companies in Malaysia, Singapore,
and the Dubai Smart City project, as well
as his own company, he has developed a
rare mix of skills for delivering end-to-end
artificial intelligence solutions, including
video intelligence, document intelligence, and
human-like chatbots. Currently, he solves B2B problems in the verticals of
healthcare, enterprise applications, industrial IoT, and retail at Symphony
AI Incubator as a deep learning AI architect. With this book, he wants to
democratize the cognitive computing and services for everyone, especially
developers, data scientists, software engineers, database engineers, data
analysts, and C-level managers.

xiii
About the Technical Reviewer
Sundar Rajan Raman has more than 14 years
of full stack IT experience in machine
learning, deep learning, and natural language
processing. He has six years of big data
development and architect experience,
including working with Hadoop and
its ecosystems as well as other NoSQL
technologies such as MongoDB and
Cassandra. In fact, he has been the technical
reviewer of several books on these topics.
He is also interested in strategizing using Design Thinking principles
and coaching and mentoring people.

xv
CHAPTER 1

Basics of TensorFlow
This chapter covers the basics of TensorFlow, the deep learning
framework. Deep learning does a wonderful job in pattern recognition,
especially in the context of images, sound, speech, language, and time-­
series data. With the help of deep learning, you can classify, predict,
cluster, and extract features. Fortunately, in November 2015, Google
released TensorFlow, which has been used in most of Google’s products
such as Google Search, spam detection, speech recognition, Google
Assistant, Google Now, and Google Photos. Explaining the basic
components of TensorFlow is the aim of this chapter.
TensorFlow has a unique ability to perform partial subgraph
computation so as to allow distributed training with the help of
partitioning the neural networks. In other words, TensorFlow allows model
parallelism and data parallelism. TensorFlow provides multiple APIs.
The lowest level API—TensorFlow Core—provides you with complete
programming control.
Note the following important points regarding TensorFlow:

• Its graph is a description of computations.

• Its graph has nodes that are operations.


• It executes computations in a given context of a session.

• A graph must be launched in a session for any


computation.

© Navin Kumar Manaswi 2018 1


N. K. Manaswi, Deep Learning with Applications Using Python,
https://doi.org/10.1007/978-1-4842-3516-4_1
Chapter 1 Basics of TensorFlow

• A session places the graph operations onto devices


such as the CPU and GPU.

• A session provides methods to execute the graph


operations.
For installation, please go to https://www.tensorflow.org/install/.
I will discuss the following topics:

T ensors
Before you jump into the TensorFlow library, let’s get comfortable with
the basic unit of data in TensorFlow. A tensor is a mathematical object
and a generalization of scalars, vectors, and matrices. A tensor can be
represented as a multidimensional array. A tensor of zero rank (order) is
nothing but a scalar. A vector/array is a tensor of rank 1, whereas a

2
Chapter 1 Basics of TensorFlow

matrix is a tensor of rank 2. In short, a tensor can be considered to be an


n-­dimensional array.
Here are some examples of tensors:

• 5: This is a rank 0 tensor; this is a scalar with shape [ ].


• [2.,5., 3.]: This is a rank 1 tensor; this is a vector
with shape [3].

• [[1., 2., 7.], [3., 5., 4.]]: This is a rank 2


tensor; it is a matrix with shape [2, 3].

• [[[1., 2., 3.]], [[7., 8., 9.]]]: This is a rank 3


tensor with shape [2, 1, 3].

Computational Graph and Session


TensorFlow is popular for its TensorFlow Core programs where it has two
main actions.

• Building the computational graph in the construction


phase

• Running the computational graph in the execution


phase

Let’s understand how TensorFlow works.

• Its programs are usually structured into a construction


phase and an execution phase.

• The construction phase assembles a graph that has


nodes (ops/operations) and edges (tensors).

• The execution phase uses a session to execute ops


(operations) in the graph.

3
Chapter 1 Basics of TensorFlow

• The simplest operation is a constant that takes no


inputs but passes outputs to other operations that do
computation.

• An example of an operation is multiplication


(or addition or subtraction that takes two matrices as
input and passes a matrix as output).

• The TensorFlow library has a default graph to which


ops constructors add nodes.

So, the structure of TensorFlow programs has two phases, shown here:

A computational graph is a series of TensorFlow operations arranged


into a graph of nodes.
Let’s look at TensorFlow versus Numpy. In Numpy, if you plan to
multiply two matrices, you create the matrices and multiply them. But in
TensorFlow, you set up a graph (a default graph unless you create another
graph). Next, you need to create variables, placeholders, and constant
values and then create the session and initialize variables. Finally, you feed
that data to placeholders so as to invoke any action.

4
Chapter 1 Basics of TensorFlow

To actually evaluate the nodes, you must run the computational graph
within a session.
A session encapsulates the control and state of the TensorFlow runtime.
The following code creates a Session object:

sess = tf.Session()

It then invokes its run method to run enough of the computational


graph to evaluate node1 and node2.
The computation graph defines the computation. It neither computes
anything nor holds any value. It is meant to define the operations
mentioned in the code. A default graph is created. So, you don’t need to
create it unless you want to create graphs for multiple purposes.
A session allows you to execute graphs or parts of graphs. It allocates
resources (on one or more CPUs or GPUs) for the execution. It holds the
actual values of intermediate results and variables.
The value of a variable, created in TensorFlow, is valid only within
one session. If you try to query the value afterward in a second session,
TensorFlow will raise an error because the variable is not initialized there.
To run any operation, you need to create a session for that graph. The
session will also allocate memory to store the current value of the variable

5
Chapter 1 Basics of TensorFlow

Here is the code to demonstrate:

Constants, Placeholders, and Variables


TensorFlow programs use a tensor data structure to represent all data—
only tensors are passed between operations in the computation graph. You
can think of a TensorFlow tensor as an n-dimensional array or list. A tensor
has a static type, a rank, and a shape. Here the graph produces a constant
result. Variables maintain state across executions of the graph.

6
Chapter 1 Basics of TensorFlow

Generally, you have to deal with many images in deep learning, so you
have to place pixel values for each image and keep iterating over all images.
To train the model, you need to be able to modify the graph to tune
some objects such as weight and bias. In short, variables enable you to
add trainable parameters to a graph. They are constructed with a type and
initial value.
Let’s create a constant in TensorFlow and print it.

Here is the explanation of the previous code in simple terms:

1. Import the tensorflow module and call it tf.

2. Create a constant value (x) and assign it the


numerical value 12.

3. Create a session for computing the values.

4. Run just the variable x and print out its current


value.
The first two steps belong to the construction phase, and the last two
steps belong to the execution phase. I will discuss the construction and
execution phases of TensorFlow now.
You can rewrite the previous code in another way, as shown here:

7
Chapter 1 Basics of TensorFlow

Now you will explore how you create a variable and initialize it. Here is
the code that does it:

Here is the explanation of the previous code:

1. Import the tensorflow module and call it tf.

2. Create a constant value called x and give it the


numerical value 12.

3. Create a variable called y and define it as being the


equation 12+11.

4. Initialize the variables with tf.global_variables_


initializer().

5. Create a session for computing the values.

6. Run the model created in step 4.


7. Run just the variable y and print out its current
value.

Here is some more code for your perusal:

8
Chapter 1 Basics of TensorFlow

Placeholders
A placeholder is a variable that you can feed something to at a later time. It
is meant to accept external inputs. Placeholders can have one or multiple
dimensions, meant for storing n-dimensional arrays.

Here is the explanation of the previous code:

1. Import the tensorflow module and call it tf.

2. Create a placeholder called x, mentioning the


float type.

3. Create a tensor called y that is the operation of


multiplying x by 10 and adding 500 to it. Note that
any initial values for x are not defined.

4. Create a session for computing the values.


5. Define the values of x in feed_dict so as to run y.

6. Print out its value.

In the following example, you create a 2×4 matrix (a 2D array) for


storing some numbers in it. You then use the same operation as before to
do element-wise multiplying by 10 and adding 1 to it. The first dimension
of the placeholder is None, which means any number of rows is allowed.

9
Chapter 1 Basics of TensorFlow

You can also consider a 2D array in place of the 1D array. Here is the
code:

This is a 2×4 matrix. So, if you replace None with 2, you can see the
same output.

But if you create a placeholder of [3, 4] shape (note that you will feed
a 2×4 matrix at a later time), there is an error, as shown here:

10
Chapter 1 Basics of TensorFlow

################# What happens in a linear model ##########


# Weight and Bias as Variables as they are to be tuned
W = tf.Variable([2], dtype=tf.float32)
b = tf.Variable([3], dtype=tf.float32)
# Training dataset that will be fed while training as Placeholders
x = tf.placeholder(tf.float32)
# Linear Model
y = W * x + b

Constants are initialized when you call tf.constant, and their values
can never change. By contrast, variables are not initialized when you call
tf.Variable. To initialize all the variables in a TensorFlow program, you
must explicitly call a special operation as follows.

It is important to realize init is a handle to the TensorFlow subgraph


that initializes all the global variables. Until you call sess.run, the
variables are uninitialized.

11
Chapter 1 Basics of TensorFlow

Creating Tensors
An image is a tensor of the third order where the dimensions belong to
height, width, and number of channels (Red, Blue, and Green).
Here you can see how an image is converted into a tensor:

12
Chapter 1 Basics of TensorFlow

You can generate tensors of various types such as fixed tensors,


random tensors, and sequential tensors.

Fixed Tensors
Here is a fixed tensor:

13
Chapter 1 Basics of TensorFlow

tf:.fill creates a tensor of shape (2×3) having a unique number.

tf.diag creates a diagonal matrix having specified diagonal elements.

tf.constant creates a constant tensor.

Sequence Tensors
tf.range creates a sequence of numbers starting from the specified value
and having a specified increment.

tf.linspace creates a sequence of evenly spaced values.

14
Chapter 1 Basics of TensorFlow

Random Tensors
tf.random_uniform generates random values from uniform distribution
within a range.

tf.random_normal generates random values from the normal


distribution having the specified mean and standard deviation.

15
Discovering Diverse Content Through
Random Scribd Documents
serious magnitude and consequence than this, How shall I apply the
funds contributed for preaching the Gospel? The Society must follow
the law of conscience too: and what men would not do as individuals
—contribute to the circulation of error, and the support of unworthy
men as ministers of the Gospel—they will not do as members of this
Society;—they will earnestly, I trust prayerfully, guard against it.
Would the friends and supporters of the Society, whilst they
remained in doubt whether they were doing good or evil in the
Church, and what character was borne by the Curates they
maintained, whether “faithful and devoted” or the reverse, (seeing
that both are to be found in the sacred office, the tares and the
wheat together,) make the exertion they now do—many of them, I
believe, out of their deep poverty—in support of the Society’s
funds? Enough has been said, I think, to shew that it is no light
thing, when it is required of us to give up our power of influencing
others for their good; no light thing, when we are asked to provide
funds for a minister, without inquiring whether he is good or bad; no
light thing, when we are asked to lose sight of our responsibility in
the application of gifts we have devoted to the glory of God.
The last thing I proposed to lay before you was the testimony of the
highest authorities of the Church to the character and services of the
Church Pastoral-Aid Society;—I may safely challenge any Society in
the Church to produce a more favourable one. The following was
the tribute of His Grace the Archbishop of Canterbury in the House
of Lords, July 27th of the present year, in the debate on the
Ecclesiastical Revenues’ Bill. After stating that “nearly 3,000,000 of
our Fellow-Christians in this land are utterly cut off from the
advantages of Religion and pastoral superintendence,” the
Archbishop adds, “The funds of Queen Anne’s Bounty, for the
augmentation of small livings, were only 12,000l. a-year; but
considerable assistance in aid of that sum was derived from the
Pastoral-Aid Society, and the Supplementary Curates’ Fund.” I
notice, first, that if the Archbishop had thought the Society was
doing more evil than good with its fund, he never could have
mentioned it thus: secondly, that it is quoted as a Church Society,
that is to say, as belonging to the Church, and doing good service in
it: thirdly, that it is placed above the Supplementary Curates’ Fund,
according to its proper place, both on account of priority of date and
greater extent of usefulness. Other tributes of our spiritual Heads
under Christ were given at the last General Meeting of the friends
and supporters of the Society in May 1840, a period not greatly
preceding Dr. Molesworth’s attack:

The Bishop of Lichfield “felt, on behalf of his diocese at least, A


GREAT DEBT OF GRATITUDE TO THIS SOCIETY; there being at that
moment thousands, he might say tens of thousands, in that
populous district, to whom the word of God was faithfully
preached every Sabbath-day, who, but for the assistance of this
Society, would have been without the means of grace, almost, if
not altogether. But his satisfaction did not arise merely from
these selfish considerations, but because he approved of the
general principles on which the Society was founded, and the
plans on which it was carried on. Those principles and plans
had been, in some instances, misrepresented, or perhaps, he
would rather say, misunderstood. There was an impression on
the minds of many, that this Society preserved to itself a kind of
jurisdiction independent of the ecclesiastical authorities.
Nothing could be more erroneous than that.”

The Bishop of Ripon said—

“He would willingly have been spared the necessity of


addressing them, but that he had one strong motive for doing
so; namely, that of declaring the singular benefits which this
Society had been the means of conferring upon the diocese over
which he had the honour to preside.”

The Bishop of Chester said—

“Over the space to which this Report refers, only seventy-one


Clergymen were engaged for this population before the time
when the aid of this Society came in; and this was one great
reason, among many others, why he should be grateful to a
Society which had enabled him to look to the vast concerns
under his care with so much less anxiety of mind, as to the
means provided for their discharge, than he could otherwise
have hoped to have done. But there was still a vast amount
remaining of the benefits which this Society had conferred upon
the Church and upon the people, and which could never be
stated in the words of a Report.”

The Bishop of Norwich said—

“I willingly come forward in support of the Church Pastoral-Aid


Society. There are two Church Pastoral-Aid Societies: they are
called rivals, but they are established entirely and solely for the
purpose of doing good. I welcome the introduction and success
of the Society; and I heartily wish it God speed, and that it may
prosper throughout the land.”

The Bishop of Winchester having been prevented by domestic


affliction from attending the last public meeting, and the Bishop of
Llandaff being absent in his diocese, their testimony is derived from
public declarations of a year previous, 1839:—
The Bishop of Winchester:—

“He was bound, then, in the spirit of unfeigned thankfulness, to


add his testimony and expression of gratitude to those already
given. He, too, could refer to that part of the country over
which he presided in spiritual things, as furnishing, to his own
knowledge, an amount of obligation to the Society for the timely
aid it had afforded to his clergy; and in many respects he could
testify both to its direct and indirect usefulness. He could point
to the stimulus to good works which it had given in many
quarters of his diocese, by the aid afforded through its
instrumentality: he could point to subscriptions raised on behalf
of additional churches; to school-rooms erected, and soon, as
his Right Rev. Brother had expressed it, to be converted into
places of worship, and endowed according to the use and form
of the National Church.” . . . “I rejoice in the existence of this
Society, and am thankful to God for having put it into the hearts
of many to aid this work of faith and labour of love.”

The Bishop of Llandaff:—

“The Right Rev. Prelate said, that though it might appear late in
the day, he had been anxious to make amends for apparent
neglect in past time, by taking part in the proceedings of the
Society, and ESPECIALLY TO EXPRESS HIS BELIEF, THAT THAT PREJUDICE,
WHICH FOR SOME TIME HAD KEPT MANY BACK FROM SUPPORTING THIS DESIGN,
WAS ENTIRELY UNFOUNDED. EXAMINATION AND EXPERIENCE HAD TAUGHT HIM,
that general, religious, and benevolent purposes HAD ANIMATED THE
PROCEEDINGS OF THE SOCIETY, and A CAUTIOUS AND SOBER-MINDED DESIRE
NOT TO DEPART FROM THE TRUE DOCTRINES AND DISCIPLINE OF THE CHURCH.
HE COULD NOT BUT ADMIRE THE CHRISTIAN TEMPER AND ABILITY WITH WHICH
THE SOCIETY HAD BEEN CONDUCTED, AND BY WHICH ITS MANAGERS HAD
ENDEAVOURED TO LIVE DOWN ALL PREJUDICE AND OPPOSITION. HE LOOKED TO
THIS SOCIETY, THEN, WHICH WAS NOT INFLUENCED BY A PARTY SPIRIT, AS A
REMEDY FOR THE EVIL. He was happy to have this opportunity of
testifying his cordial approval of the designs and operations of
this Society.”

The late Bishop of Chichester (as well as the present, a Vice Patron of
the Society), in supporting the Resolution, bore his testimony to the
excellent effects produced by this Society, not only upon the country
at large, but upon that sphere of Christian action over which he had
the superintendence.
There is but one Layman whose testimony I shall quote; for I know
not where I should find another worthy to be added to the above
list, as an equally devoted and energetic friend of the Church, and of
this Society. It is not so much Lord Ashley as President of the
Society, I quote, as Lord Ashley known and esteemed in every
relation of life, public and domestic, in office and out of office,—by
the Court, the statesman, the operative, and the Christian. At the
last public meeting, Lord Ashley speaks thus:—

“Perhaps in the history of all the Religious Societies, there was


no parallel to the sudden rise and rapid progress of that which
they were that day celebrating; no one on which the blessing of
God had more immediately and more manifestly been
bestowed. It was the very thing demanded by the exigency of
the times: and had accomplished, in proportion to its means,
the entire object for which it was instituted. Of its holy and
beneficial effects on private life, wherever its labours extended,
he would say nothing; they were amply and nobly recorded in
the periodical Reports; but he would assert his firm and
conscientious belief, that the operations of the Society had
mainly contributed to abate the hostility that had raged against
the Church of England; by making her known among those by
whom she was little known, to render her honoured and
beloved, and to enable her friends in another place to fight,
under God’s providence, the great battle of our civil and
ecclesiastical constitution.”

Here my labours might appropriately end, Dear friends and


supporters of the Church Pastoral-Aid Society! with giving you the
voice of the highest authorities of the Church in our favour. All,
therefore, I shall permit myself to add, is an appeal to Dr.
Molesworth himself—as one to whom we bear no ill-will; as one who
has not injured us at all, but rather himself, by his late attack—
warning him not again to peril his respectable name on such an
unjust and injudicious tirade (for I can call it nothing else) against
this Society;—a Society so shielded from his attacks, that he can
only injure it through the sides of the Church, of which this Society is
as a specimen of the young wood, and vigorous growth, from that
old yet glorious stem, planted by the hands of the Apostles, and
rooted in Christ. I exhort him to lay aside his prejudice and his
opposition, and join the Society—as many of our members, I hear,
have joined his; when we will work together, “the Lord being our
helper,” to make the Society as perfect as we can. Then, surely, he
would learn to look at things in a more cheerful aspect, and with less
jaundiced eye, than to be raising a cry of “schism” (p. 9) in the
Church—a reproach which could hardly be expected, and would
certainly be untrue (according to any definition that I have heard of
the word), even in the mouth of a bigoted Dissenter. I would appeal
to the Most Reverend Prelate from whom Dr. Molesworth’s
preferment was derived (and whose known gentleness should have
taught the Clergyman whom he had preferred, “a more excellent
way”), not to suffer this unseemly widening of breaches in the
Church, if there be such; or, as I think, opening them, where they
would not exist without. Is this “the comprehensive, healing, uniting
spirit of the Articles” (p. 15) which Dr. Molesworth loves? If it is, I
hope he will pardon me for saying (for I wish we might part friends),
that his is the most abstract love of the principle of which I can form
an idea. For my part, I have never either made or acknowledged
party distinctions in the Church; nor will I be provoked to do so
now. The Church I have ever wished to regard as one body, with
that mixture of unworthiness in members which is consequent upon
the imperfect condition of all things here below: and I trust I do
honour the Church too much, lightly to foment her distractions, or
expose her troubles to her numerous foes. Yet do not mistake, Dr.
Molesworth;—I value the Church for the sake of the Gospel, not the
Gospel for the sake of the Church;—I value both Church and Gospel
for their own sakes, and, by God’s blessing, will support and defend
both, according to my poor ability: but it is a truth I am not
ashamed to confess, that if by ‘Church’ is to be understood the
outward frame-work of this or any other Church, I value the
everlasting Gospel even more, and much more than I do the Church.
—The Vicar of Rochdale may have time for controversy: I have not.
I have given him once for all what appeared to me to be a full and
satisfactory explanation of the points at issue: let the Society—those
to whom I address myself—judge. I was quite unwilling that the
Committee should follow Dr. Molesworth to the field: I felt,
therefore, the more ready to give him the meeting myself.
I am, &c. Caleb Whitefoord.
Hamilton Terrace, St. John’s Wood,
January 5, 1841.
Note.—“We feel some difficulty in adopting the nomination, not from
any doubt of Mr.—’s moral character, or of his activity in his
ministerial duty, but because we do not see that evidence which we
desire to receive of the orthodoxy of his preaching:—that we are
deeply convinced that activity in the ministry can only be useful so
far as it is connected with the promulgation of those doctrines which
are taught in Holy Scriptures, and exhibited by the Church as the
prominent truths of Divine Revelation. We do not mean to impute to
Mr. — deficiency in this respect, but we wish to be satisfied that his
instructions are such as, under God’s blessing, will promote the great
end for which our Society has been established—the salvation of
souls through the instrumentality of ‘faithful and devoted men.’”
N.B. A specimen of the “hide-and-seek phraseology,” from the
Collection of the Church Pastoral-Aid Society, presented by the Rev.
Dr. Molesworth.

Printed by Richard Watts, Crown Court, Temple Bar.


FOOTNOTES.

[3] What other inference can be drawn from p. 39 of the Appendix,


—where he says, “I have adduced strong cases, collected with ease,
against the Society. I now lay myself out for them; and request
those Clergy, who have been in similar circumstances with regard to
the Pastoral-Aid Society, to send me in their cases (postage pre-
paid), and the documents supporting them.”?
[4] “Every Churchman belonging to it should withdraw his support,
and transfer that support to the liberal and truly Church SOCIETY FOR
PROMOTING THE EMPLOYMENT OF ADDITIONAL CURATES.” (The Italics and
Capitals are Dr. Molesworth’s.) P. 39, Appendix.
[18] See the Note at the end of this Letter.
*** END OF THE PROJECT GUTENBERG EBOOK LETTER TO THE
FRIENDS AND SUBSCRIBERS OF THE CHURCH PASTORAL-AID
SOCIETY ***

Updated editions will replace the previous one—the old editions will
be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States copyright in
these works, so the Foundation (and you!) can copy and distribute it
in the United States without permission and without paying
copyright royalties. Special rules, set forth in the General Terms of
Use part of this license, apply to copying and distributing Project
Gutenberg™ electronic works to protect the PROJECT GUTENBERG™
concept and trademark. Project Gutenberg is a registered trademark,
and may not be used if you charge for an eBook, except by following
the terms of the trademark license, including paying royalties for use
of the Project Gutenberg trademark. If you do not charge anything
for copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such as
creation of derivative works, reports, performances and research.
Project Gutenberg eBooks may be modified and printed and given
away—you may do practically ANYTHING in the United States with
eBooks not protected by U.S. copyright law. Redistribution is subject
to the trademark license, especially commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the free


distribution of electronic works, by using or distributing this work (or
any other work associated in any way with the phrase “Project
Gutenberg”), you agree to comply with all the terms of the Full
Project Gutenberg™ License available with this file or online at
www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand, agree
to and accept all the terms of this license and intellectual property
(trademark/copyright) agreement. If you do not agree to abide by all
the terms of this agreement, you must cease using and return or
destroy all copies of Project Gutenberg™ electronic works in your
possession. If you paid a fee for obtaining a copy of or access to a
Project Gutenberg™ electronic work and you do not agree to be
bound by the terms of this agreement, you may obtain a refund
from the person or entity to whom you paid the fee as set forth in
paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only be


used on or associated in any way with an electronic work by people
who agree to be bound by the terms of this agreement. There are a
few things that you can do with most Project Gutenberg™ electronic
works even without complying with the full terms of this agreement.
See paragraph 1.C below. There are a lot of things you can do with
Project Gutenberg™ electronic works if you follow the terms of this
agreement and help preserve free future access to Project
Gutenberg™ electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright law
in the United States and you are located in the United States, we do
not claim a right to prevent you from copying, distributing,
performing, displaying or creating derivative works based on the
work as long as all references to Project Gutenberg are removed. Of
course, we hope that you will support the Project Gutenberg™
mission of promoting free access to electronic works by freely
sharing Project Gutenberg™ works in compliance with the terms of
this agreement for keeping the Project Gutenberg™ name associated
with the work. You can easily comply with the terms of this
agreement by keeping this work in the same format with its attached
full Project Gutenberg™ License when you share it without charge
with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside the
United States, check the laws of your country in addition to the
terms of this agreement before downloading, copying, displaying,
performing, distributing or creating derivative works based on this
work or any other Project Gutenberg™ work. The Foundation makes
no representations concerning the copyright status of any work in
any country other than the United States.

1.E. Unless you have removed all references to Project Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project Gutenberg™
work (any work on which the phrase “Project Gutenberg” appears,
or with which the phrase “Project Gutenberg” is associated) is
accessed, displayed, performed, viewed, copied or distributed:
This eBook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this eBook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.

1.E.2. If an individual Project Gutenberg™ electronic work is derived


from texts not protected by U.S. copyright law (does not contain a
notice indicating that it is posted with permission of the copyright
holder), the work can be copied and distributed to anyone in the
United States without paying any fees or charges. If you are
redistributing or providing access to a work with the phrase “Project
Gutenberg” associated with or appearing on the work, you must
comply either with the requirements of paragraphs 1.E.1 through
1.E.7 or obtain permission for the use of the work and the Project
Gutenberg™ trademark as set forth in paragraphs 1.E.8 or 1.E.9.

1.E.3. If an individual Project Gutenberg™ electronic work is posted


with the permission of the copyright holder, your use and distribution
must comply with both paragraphs 1.E.1 through 1.E.7 and any
additional terms imposed by the copyright holder. Additional terms
will be linked to the Project Gutenberg™ License for all works posted
with the permission of the copyright holder found at the beginning
of this work.

1.E.4. Do not unlink or detach or remove the full Project


Gutenberg™ License terms from this work, or any files containing a
part of this work or any other work associated with Project
Gutenberg™.

1.E.5. Do not copy, display, perform, distribute or redistribute this


electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the Project
Gutenberg™ License.

1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if you
provide access to or distribute copies of a Project Gutenberg™ work
in a format other than “Plain Vanilla ASCII” or other format used in
the official version posted on the official Project Gutenberg™ website
(www.gutenberg.org), you must, at no additional cost, fee or
expense to the user, provide a copy, a means of exporting a copy, or
a means of obtaining a copy upon request, of the work in its original
“Plain Vanilla ASCII” or other form. Any alternate format must
include the full Project Gutenberg™ License as specified in
paragraph 1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™ works
unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or providing


access to or distributing Project Gutenberg™ electronic works
provided that:

• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt
that s/he does not agree to the terms of the full Project
Gutenberg™ License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project Gutenberg™


electronic work or group of works on different terms than are set
forth in this agreement, you must obtain permission in writing from
the Project Gutenberg Literary Archive Foundation, the manager of
the Project Gutenberg™ trademark. Contact the Foundation as set
forth in Section 3 below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on, transcribe
and proofread works not protected by U.S. copyright law in creating
the Project Gutenberg™ collection. Despite these efforts, Project
Gutenberg™ electronic works, and the medium on which they may
be stored, may contain “Defects,” such as, but not limited to,
incomplete, inaccurate or corrupt data, transcription errors, a
copyright or other intellectual property infringement, a defective or
damaged disk or other medium, a computer virus, or computer
codes that damage or cannot be read by your equipment.

1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except for


the “Right of Replacement or Refund” described in paragraph 1.F.3,
the Project Gutenberg Literary Archive Foundation, the owner of the
Project Gutenberg™ trademark, and any other party distributing a
Project Gutenberg™ electronic work under this agreement, disclaim
all liability to you for damages, costs and expenses, including legal
fees. YOU AGREE THAT YOU HAVE NO REMEDIES FOR
NEGLIGENCE, STRICT LIABILITY, BREACH OF WARRANTY OR
BREACH OF CONTRACT EXCEPT THOSE PROVIDED IN PARAGRAPH
1.F.3. YOU AGREE THAT THE FOUNDATION, THE TRADEMARK
OWNER, AND ANY DISTRIBUTOR UNDER THIS AGREEMENT WILL
NOT BE LIABLE TO YOU FOR ACTUAL, DIRECT, INDIRECT,
CONSEQUENTIAL, PUNITIVE OR INCIDENTAL DAMAGES EVEN IF
YOU GIVE NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.

1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you


discover a defect in this electronic work within 90 days of receiving
it, you can receive a refund of the money (if any) you paid for it by
sending a written explanation to the person you received the work
from. If you received the work on a physical medium, you must
return the medium with your written explanation. The person or
entity that provided you with the defective work may elect to provide
a replacement copy in lieu of a refund. If you received the work
electronically, the person or entity providing it to you may choose to
give you a second opportunity to receive the work electronically in
lieu of a refund. If the second copy is also defective, you may
demand a refund in writing without further opportunities to fix the
problem.

1.F.4. Except for the limited right of replacement or refund set forth
in paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO
OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.

1.F.5. Some states do not allow disclaimers of certain implied


warranties or the exclusion or limitation of certain types of damages.
If any disclaimer or limitation set forth in this agreement violates the
law of the state applicable to this agreement, the agreement shall be
interpreted to make the maximum disclaimer or limitation permitted
by the applicable state law. The invalidity or unenforceability of any
provision of this agreement shall not void the remaining provisions.

1.F.6. INDEMNITY - You agree to indemnify and hold the Foundation,


the trademark owner, any agent or employee of the Foundation,
anyone providing copies of Project Gutenberg™ electronic works in
accordance with this agreement, and any volunteers associated with
the production, promotion and distribution of Project Gutenberg™
electronic works, harmless from all liability, costs and expenses,
including legal fees, that arise directly or indirectly from any of the
following which you do or cause to occur: (a) distribution of this or
any Project Gutenberg™ work, (b) alteration, modification, or
additions or deletions to any Project Gutenberg™ work, and (c) any
Defect you cause.

Section 2. Information about the Mission


of Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new computers.
It exists because of the efforts of hundreds of volunteers and
donations from people in all walks of life.

Volunteers and financial support to provide volunteers with the


assistance they need are critical to reaching Project Gutenberg™’s
goals and ensuring that the Project Gutenberg™ collection will
remain freely available for generations to come. In 2001, the Project
Gutenberg Literary Archive Foundation was created to provide a
secure and permanent future for Project Gutenberg™ and future
generations. To learn more about the Project Gutenberg Literary
Archive Foundation and how your efforts and donations can help,
see Sections 3 and 4 and the Foundation information page at
www.gutenberg.org.

Section 3. Information about the Project


Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-profit
501(c)(3) educational corporation organized under the laws of the
state of Mississippi and granted tax exempt status by the Internal
Revenue Service. The Foundation’s EIN or federal tax identification
number is 64-6221541. Contributions to the Project Gutenberg
Literary Archive Foundation are tax deductible to the full extent
permitted by U.S. federal laws and your state’s laws.

The Foundation’s business office is located at 809 North 1500 West,


Salt Lake City, UT 84116, (801) 596-1887. Email contact links and up
to date contact information can be found at the Foundation’s website
and official page at www.gutenberg.org/contact

Section 4. Information about Donations to


the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission of
increasing the number of public domain and licensed works that can
be freely distributed in machine-readable form accessible by the
widest array of equipment including outdated equipment. Many
small donations ($1 to $5,000) are particularly important to
maintaining tax exempt status with the IRS.

The Foundation is committed to complying with the laws regulating


charities and charitable donations in all 50 states of the United
States. Compliance requirements are not uniform and it takes a
considerable effort, much paperwork and many fees to meet and
keep up with these requirements. We do not solicit donations in
locations where we have not received written confirmation of
compliance. To SEND DONATIONS or determine the status of
compliance for any particular state visit www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states where


we have not met the solicitation requirements, we know of no
prohibition against accepting unsolicited donations from donors in
such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot make


any statements concerning tax treatment of donations received from
outside the United States. U.S. laws alone swamp our small staff.

Please check the Project Gutenberg web pages for current donation
methods and addresses. Donations are accepted in a number of
other ways including checks, online payments and credit card
donations. To donate, please visit: www.gutenberg.org/donate.

Section 5. General Information About


Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could be
freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose network of
volunteer support.
Project Gutenberg™ eBooks are often created from several printed
editions, all of which are confirmed as not protected by copyright in
the U.S. unless a copyright notice is included. Thus, we do not
necessarily keep eBooks in compliance with any particular paper
edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg Literary
Archive Foundation, how to help produce our new eBooks, and how
to subscribe to our email newsletter to hear about new eBooks.
back
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