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

Download Deep Learning with Applications Using Python Chatbots and Face, Object, and Speech Recognition With TensorFlow and Keras Springerlink (Online Service) ebook All Chapters PDF

Learning

Uploaded by

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

Download Deep Learning with Applications Using Python Chatbots and Face, Object, and Speech Recognition With TensorFlow and Keras Springerlink (Online Service) ebook All Chapters PDF

Learning

Uploaded by

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

Download the Full Version of textbook for Fast Typing at textbookfull.

com

Deep Learning with Applications Using Python


Chatbots and Face, Object, and Speech Recognition
With TensorFlow and Keras Springerlink (Online
Service)
https://textbookfull.com/product/deep-learning-with-
applications-using-python-chatbots-and-face-object-and-
speech-recognition-with-tensorflow-and-keras-springerlink-
online-service/

OR CLICK BUTTON

DOWNLOAD NOW

Download More textbook Instantly Today - Get Yours Now at textbookfull.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Deep Learning with Python Develop Deep Learning Models on


Theano and TensorFLow Using Keras Jason Brownlee

https://textbookfull.com/product/deep-learning-with-python-develop-
deep-learning-models-on-theano-and-tensorflow-using-keras-jason-
brownlee/
textboxfull.com

Deep Learning Projects Using TensorFlow 2: Neural Network


Development with Python and Keras 1st Edition Vinita
Silaparasetty
https://textbookfull.com/product/deep-learning-projects-using-
tensorflow-2-neural-network-development-with-python-and-keras-1st-
edition-vinita-silaparasetty/
textboxfull.com

Reinforcement Learning: With Open AI, TensorFlow and Keras


Using Python 1st Edition Abhishek Nandy

https://textbookfull.com/product/reinforcement-learning-with-open-ai-
tensorflow-and-keras-using-python-1st-edition-abhishek-nandy/

textboxfull.com

Applied Reinforcement Learning with Python: With OpenAI


Gym, Tensorflow, and Keras Beysolow Ii

https://textbookfull.com/product/applied-reinforcement-learning-with-
python-with-openai-gym-tensorflow-and-keras-beysolow-ii/

textboxfull.com
Beginning Anomaly Detection Using Python-Based Deep
Learning: With Keras and PyTorch Sridhar Alla

https://textbookfull.com/product/beginning-anomaly-detection-using-
python-based-deep-learning-with-keras-and-pytorch-sridhar-alla/

textboxfull.com

Computer Vision Using Deep Learning Neural Network


Architectures with Python and Keras 1st Edition Vaibhav
Verdhan
https://textbookfull.com/product/computer-vision-using-deep-learning-
neural-network-architectures-with-python-and-keras-1st-edition-
vaibhav-verdhan/
textboxfull.com

Biota Grow 2C gather 2C cook Loucas

https://textbookfull.com/product/biota-grow-2c-gather-2c-cook-loucas/

textboxfull.com

Applied Neural Networks with TensorFlow 2: API Oriented


Deep Learning with Python Orhan Gazi Yalç■n

https://textbookfull.com/product/applied-neural-networks-with-
tensorflow-2-api-oriented-deep-learning-with-python-orhan-gazi-yalcin/

textboxfull.com

Practical Machine Learning and Image Processing: For


Facial Recognition, Object Detection, and Pattern
Recognition Using Python Himanshu Singh
https://textbookfull.com/product/practical-machine-learning-and-image-
processing-for-facial-recognition-object-detection-and-pattern-
recognition-using-python-himanshu-singh/
textboxfull.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 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 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
Another Random Scribd Document
with Unrelated Content
The Project Gutenberg eBook of Letters written in
France, to a friend in London, between the month of
November 1794, and the month of May 1795
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.

Title: Letters written in France, to a friend in London, between the


month of November 1794, and the month of May 1795

Author: Watkin Tench

Release date: August 12, 2024 [eBook #74234]

Language: English

Original publication: London: J. Johnson, 1796

Credits: Chuck Greif, MWS and the Online Distributed Proofreading


Team at https://www.pgdp.net (This book was produced
from images made available by the HathiTrust Digital
Library.)

*** START OF THE PROJECT GUTENBERG EBOOK LETTERS


WRITTEN IN FRANCE, TO A FRIEND IN LONDON, BETWEEN THE
MONTH OF NOVEMBER 1794, AND THE MONTH OF MAY 1795 ***
PREFACE.
LETTER: I., II., III., IV., V., VI., VII., VIII., IX., X., XI., XII.
FOOTNOTES.

LETTERS

WRITTEN IN FRANCE,

TO A

FRIEND IN LONDON,

BETWEEN THE MONTH OF NOVEMBER 1794,

AND

THE MONTH OF MAY 1795.

By Major T E N C H, of the Marines,


LATE OF HIS MAJESTY’S SHIP ALEXANDER.

LONDON:
PRINTED FOR J. JOHNSON, ST. PAUL’S CHURCH-YARD.
M.DCC.XCVI.
PREFACE.

T HE following Letters were written under very adverse circumstances, in


a part of France remote from the beaten track in which travellers
generally keep, and where curiosity has seldom led to observation. As
connected with that stupendous object, which has concentrated the attention
not only of Europe, but of every quarter of this planet where human
communications reach, they are offered to the Public. A considerable part of
the collection was unavoidably dedicated to matters which must, from their
nature, be uninteresting to a majority of readers; but the author trusts to the
importance of the subject to compensate for the poverty of the relation.
Since his return to England they have been revised; and would have been
earlier sent to the press, had not reasons of a private nature interposed to
procrastinate his intention.
LETTER I.
MY DEAR FRIEND,
On board le Marat,
Brest, 9th Nov. 1794.

A PERFORMANCE of those flattering promises, which we exchanged at


parting, to meet for a few days in London, about Christmas next,
provided the exigencies of service would permit, must be suspended
for the present—to be fulfilled when—is one of those secrets of futurity,
which I dare not trust my imagination to anticipate.
The wayward fortune of your friend has again[A] exposed him to be
taken by the “insolent foe,” after an unsuccessful, but I trust not inglorious
combat, against very superior force. This disastrous event happened on the
6th instant.[B]—— — —— —— —— —— —— — —— —— —— ——
——
To our great surprize, the enemy’s ships continued to fire upon us after
our colours were struck. At first we conceived, that this unprovoked
prolongation of hostilities arose from their not seeing that we had
surrendered; but when their knowledge of this event could no longer be
doubted, and the firing did not cease, some among us, joining to this
conduct a recollection of the decree of the convention, which forbade
quarter to be extended to Englishmen, were almost ready to believe, that it
was designed to be executed upon us; and so irritated were our seamen, by
this apparently wanton continuation of attack, that they had once nearly
determined to renew the fight, and sell their lives as dearly as possible. At
length, however, their firing ceased.
Knowing from sad experience, that in such a situation all distinction of
property is confounded, and that the officers and public stores of the ship
become at once the indiscriminate prey of the enemy and their own crew, I
left the deck, and descended into the bread-room. There I had in the
morning deposited one of my trunks, out of which I filled a clothes-bag
with such necessaries as I thought would be most useful to me, and left it in
the charge of my servant, while I endeavoured to save a part of what a very
large trunk, lodged in the marine store-room, contained. But this resolution
I was incapable of effecting. The cock-pit, which I was obliged to pass
through, presented such a scene of misery, as banished every feeling, but
sorrow and pity. I found myself encompassed at once by the dead and the
dying. The groans of the latter, joined to the cries of the wounded, on whom
operations were performing by the surgeon, and to the blood which
overflowed my feet, filled me with horror and disgust.

“Sight so deform what heart of rock could long


“Dry-ey’d behold?”—— Milton.

It “quelled my best of man;” and, after two ineffectual attempts to penetrate


across this stage of woe, I returned to my servant, and made a few farther
arrangements of what was left to me.
By this time the French boats had boarded us, and taken possession of
the ship. When I attempted to ascend to the deck, I found every hatchway
guarded by French sentinels, who refused to let me pass. In vain did I
expostulate with them; all the answer I could obtain was, “Citoyen, tels sont
mes ordres. Je suis républicain!” At length I saw a French officer, and
begged his interference, which, after some hesitation, was granted, and on
his speaking to the sentinel, I was suffered to proceed to the deck, where I
found all that confusion and disorder reigning which I had expected. The
Admiral had, I learned, been already sent away. I enquired for the French
commanding officer, and was directed to a respectable looking old man, to
whom I presented my sword, telling him, at the same time, that I hoped, and
trusted, we should be allowed to retain our private property, and be
protected from pillage. He answered me, that we certainly should. I had,
however, but just turned from him, when a French officer seized on my
cross-belt, and demanded it. On my refusing to comply with this mandate,
he said it was arms; which I denied, and bade him, if he thought I had not
made a full surrender of those, to search me. To all the arguments and
protestations which I could use, this gentleman thought proper to answer by
force only; so that, finding farther resistance vain, I yielded up the belt to
him, when his motive for diverting me of this dangerous implement of war,
at once appeared—a large silver plate, which was attached to it, being the
bait. This he very composedly took off and put in his pocket, trailing the
belt carelessly along after him as he marched away.
The commanding officer being extremely urgent that we should quit the
ship directly, I got leave to make another effort to recover some more of my
effects; but universal plunder and uproar had now taken place. The store-
rooms and cabins were broken open and pillaged, and the most brutal
excesses committed. I was surprized to find the French seamen and soldiers
even more forward than our own, in searching for wine and spirits, and
equally eager to intoxicate themselves: a new trait in their national
character.
About four o’clock I quitted the Alexander, carrying with me my bag,
which was all I had been able to save, and was conducted, with several
other officers, on board Le Marat, a name of ill omen, and not too
predictive, thought I, when I heard it proclaimed, of the virtues of humanity
and generosity. Here I found our gallant and respected commander, who
introduced me to Captain Le Franq, the commander of the ship, by whom I
was civilly received. This gentleman speaks very good English, which he
learned in the last war, when he was a prisoner in England and in the East
Indies. In a very candid manner, he repeatedly desired us not to be under
any apprehensions about the treatment which we were to receive; for that if
he, or any of his officers or men, should be found guilty of ill using
prisoners of war, the republic would punish the offenders. When we
complained to him of having been plundered, he protested, that he had
given the strictest orders to forbid it to those who had boarded us; and that
he was sure they could not be the authors of our losses, as his officers were
all gentlemen (he spoke in English) and his men in a state of the most
exemplary discipline. We answered, that among the great number of boats
which had boarded the Alexander, from every ship in the squadron, it was
impossible for strangers to point out either the names or the persons, or the
ships to which the parties might belong; and that we chiefly attributed our
losses to the precipitancy by which we had been compelled to quit our own
ship. Upon hearing this, Captain Le Franq very fairly and honourably
proposed, that one of ourselves should be selected, and sent on board the
Alexander, in order to bring away whatever could be found belonging to
any of us. We thanked him for his offer, and embraced it; but the officer
who went on this service was able to obtain very little. Some few articles,
indeed, he did recover; and to-day, as many more of us as chose to go again
on a similar errand, were permitted, and French officers were sent with us,
to enforce the order for a search: it was conducted in a very open and liberal
manner, although it ended almost as fruitlessly as the former, the possessors
of their newly-acquired property having taken effectual means to secrete
nine parts in ten of it from our scrutiny. My large trunk, however, I
discovered, close to the door of the store-room, wherein it had been
deposited. I blessed my good fortune, and sprang to it: but what was my
mortification, to find, that of all its former treasures (having closely packed
it with my most valuable articles) nothing remained but two bits of black
ribbon, serving to fasten my gorget!
We had been more than two hours in Captain Le Franq’s cabin, without
having had any refreshment offered to us, when, at about six o’clock,
supper was announced. The captain, inviting Admiral Bligh, and all of us, to
follow him, led us into the ward-room, where we found the banquet spread,
and all the officers of the etat-major, or ward-room mess, assembled. I was
no stranger (as you know) to the customs of the French on land, which were
never remarkable for delicacy and cleanliness; but I had never before seen
their mode of living on board their ships of war. Our entertainment was
served up on a large clumsy deal table, which was placed (to speak in sea-
language) not fore and aft, but athwart ship, very awkwardly and
inconveniently, surrounded by benches and lockers, and in place of a table-
cloth was covered by a piece of green painted canvas. Sweet are the joys of
hunger, on such an occasion! After a fast of thirteen hours, and that in a day
of such unceasing agitation as we had passed, neither this circumstance, nor
the garlic with which the meat abounded; nor a want of knives and forks,
and a change of plates; nor the battling of the mousses (dirty ragged cabin-
boys) for the scraps which were left; nor the appearance of the company,
who all sat with their hats, or red caps, on; nor their vociferation of the
word Citoyen, the only title they used in pledging each other to republican
toasts, could prevent me from making a most satisfactory repast. Nothing
short of the evidence of my senses could, nevertheless, have made me
believe, that so much filthiness could be quietly submitted to, when it might
be so easily prevented. Indeed, a ship is in all situations very unfavourable
to scrupulous nicety; but no description can convey an adequate idea to a
British naval officer, who has not witnessed it, of the gross and polluted
state in which the French habitually keep all parts of their vessels, if I may
judge from what I see in this. And to complete the jest, Captain Le Franq
has more than once boasted to us of the superior attention which he pays to
the cleanliness of his ship.
In the course of our conversation at supper, we learned, that this
squadron had been purposely dispatched from Brest, to intercept us on our
outward-bound passage, being furnished with exact intelligence of the time
we had put into Plymouth, and of our force and destination[C].
But to proceed with the adventures of your friend in a regular detail.
After supper, Admiral Bligh, and those officers who had saved their beds,
went up into the cabin, where places to sleep in were allotted to them, while
a sail was spread below, for the majority who had lost their’s, in which
number I was included. This humble couch, which was as good as
circumstances would allow our hosts to furnish, or as we could reasonably
expect, would have been perfectly satisfactory to us, had we been permitted
to retire to it. But our entertainers, no longer checked by the presence of
their chief, who had retired, and elated by victory, and by an anticipation of
the triumph which awaited them at Brest, on the novel and glorious
atchievement of capturing a British 74 gun ship, now called for a fresh
supply of wine, and began to sing, in a loud key, republican songs, which
were interrupted only by questions to us, that delicacy should have
withholden them from asking. One of them, taking a candle in his hand,
begged me to look at two prints of heads, as large as life, of Pelletier and
Marat, “Ah!” said he, pointing to the latter, “behold the friend of the
people! he who shed his blood for them!” I looked, as he had desired me,
and thought I saw all the diabolical qualities, by which that monster was
marked in his life-time, depicted in this portrait. Prudence, however, kept
me silent. Poor Pelletier came in for no share of this gentleman’s eulogy;
and as to Robespierre, they all spoke of him, and “his reign,” with great
bitterness and detestation.
We were compelled to rise at a very early hour next morning, the sail on
which we had slept being wanted. I would willingly have walked on the
quarter-deck, according to the English custom; but it was so crowded by the
men, and so greasy and slippery, that I found it impracticable. The captain,
overhearing us talk on this subject, very gravely said, that he never allowed
his people to eat between decks, but always made them do so upon deck, in
order to keep his ship clean. When we saw that after these meals they
neither scraped nor washed the decks, we were at no loss to account for the
state in which we found them; and no doubt those whom it professionally
concerned, duly noted this curious improvement in the œconomy of a ship
of war.
About eight o’clock the boatswain and his mates went to the different
hatchways of the ship, and summoned the crew in a loud voice, “aux
prières.” My ignorance of what these prayers might be, did not long
continue. The quarter-deck was immediately thronged by men and officers,
who with united voice sang the Marseilles Hymn, with a fervor and
enthusiasm of manner which astonished me. I had heard it at a distance on
the preceding evening; and upon enquiry learned, that it was thus publickly
performed twice a day, by order of the government. The sublime music of
this fine lyric composition, the gaiety breathed by the Carmagnole, and by
many other popular airs which are continually in their mouths, during their
most ordinary occupations, must produce a prodigious effect on the pliant
minds of Frenchmen, and highly contribute to invigorate that spirit of
idolatry for a republic, and that hatred and contempt of monarchy, which it
is so much the interest of their leaders to encourage. I need not point out to
you the good policy of such national establishments, and how deep a
knowledge of human nature they manifest; perhaps no other country is so
culpably indifferent to the foundation of similar institutions as our own. We
fire, indeed, a few lazy guns on the anniversaries of the King’s birth,
accession, and other similar occasions; but we never stimulate the passions
of our soldiery, by recalling to their memories, in periodic exhibitions, the
days on which their forefathers won the fields of Agincourt, Blenheim, and
Minden; nor re-animate the ardent energy of our seamen, by public recitals
of the victories of a Russel, a Hawke, a Rodney, and a Howe. And yet the
histories of the greatest nations, both ancient and modern, sufficiently
demonstrate the power of such exhibitions over the human mind; and justify
me in affirming, that no people ever rose to superlative dominion who did
not employ them. How would the flame of heroism be enkindled in our
youth, on hearing these celebrations performed by the veterans of Chelsea
and Greenwich! And what still more important sentiments would be
diffused through the mass of our people, if they were frequently reminded
of those glorious æras, when John was compelled to sign Magna Charta;
and when the declaration of the rights of the people was made the
foundation of William’s throne!
This digression towards a country, which busy remembrance points to
with unceasing anxiety, could not be suppressed. To proceed with my
observations here:—The republican spirit is inculcated not in songs only,
for in every part of the ship I find emblems purposely displayed to awaken
it. All the orders relating to the discipline of the crew are hung up, and
prefaced by the words Liberté, Egalité, Fraternité, ou la Mort, written in
capital letters. The bonnet rouge, or cap of liberty, is erected in several
places, and crowns the figure on the prow of the ship, which represents the
demagogue whose name she bears, and on which is written an extract from
the declaration of the rights of man. In the cabin (to which the officers are
entitled to resort at all times) Liberté & Egalité are pourtrayed in female
characters, the former brandishing a sword, and the latter nursing a
numerous offspring, with impartial attention to the wants of all. But a
picture of another sort also caught my eye: it was pasted on the outside of a
door, which led to the apartment of an officer, and represented the prime
minister of Great Britain conducting to a guillotine his blindfolded
sovereign. The person to whom it belonged, on seeing me regard it with
mingled indignation and contempt, would have begun a conversation on the
subject, had I not prevented him by turning my back and walking away.
Indeed, next to the poor emigrants, Mr. Pitt, or “Ministre Peet,” as they
always call him, seems to be the primary object of their abhorrence. Hated
name! never breathed but in curses, never coupled but with execrations! To
hear them, one would suppose that he is the only man in England hostile to
their growing republic. Even Captain Le Franq, who has certainly hitherto
behaved towards us with more delicacy than the other officers, did not
scruple to call him “a Robespierre.” To argue with these people I find
impossible; “but to be grave exceeds all power of face.” My only resource,
on such occasions, is to ask some question foreign to the subject they wish
to talk upon: even here I can make no progress; I am either repulsed by
want of common knowledge, or bewildered in contradiction. Having
established it as a maxim, that some degree of information may always be
gained by talking to men of their own professions, I am as inquisitive as I
modestly can be, about their naval institutions. But, if my question be heard
by more than one, such shocking abrupt oppositions of opinion follow, and
so pertinaciously does each party defend his assertion on the most ordinary
points, that my only alternative, to prevent a perfect equilibrium of mind, is
to place the little confidence left at my disposal in the champion who has
been least violent and vociferous; agreeably to the old observation, which
says, the still stream is the deepest. Their ignorance, indeed, upon almost
every subject which has been stated, is deplorable. One of them, in pure
simplicity of heart, asked me if London were as large as Brest? I was
contented to answer him, by saying I had never seen Brest. He was greatly
surprized, on being informed that London is a sea-port; and, to recompense
me for my intelligence, told me Paris did not enjoy that advantage, as he
had heard, for he confessed he had never been there. A second had read
Shakespeare, “and did not like him; he was too sombre.”—“Pray, sir, do
you allude to any particular play?” He seemed confounded; but, after some
hesitation, said, “Yes, to Paucippe.”—“To Paucippe!” exclaimed I; “you
mistake the name, there is not any of his plays which bears such a title.” He
was confident he was right, and therefore I begged to know the fable of the
piece, or the names of the other characters; but with them, this critical
reader did not pretend to any acquaintance. I need not observe to you, that
none of these officers had ever served in the navy of France, but in the most
subordinate capacities, under the king’s government, except the captain,
who had commanded a cutter under Monsieur de Suffrein, but who had
nevertheless been bred up in the service of the East India company.
We anchored in Brest-Water about three o’clock this morning, and I
presume to hope we shall very soon be sent on shore; but whether, or not,
on parole, does not seem quite clear. They answer with great ambiguity, and
apparent unwillingness, to all questions on this head, pretending that they
are ignorant of what is customary, but assuring us that we shall be treated
well. To be shut up in a prison, in this cold and dreary season that is coming
on, is what I dread to look forward to. We frequently describe to them the
parole which is allowed to all French officers in England. But, whatever is
to be our lot, I shall not wonder at their taking almost any step to rid
themselves of so numerous a troop of intruders on their society and table.
Their own mess consists of sixteen persons, besides the captain, who lives
in common with his officers, although this association, they tell me, is
forbidden in their naval instructions; but it seems these little deviations are
winked at, in certain cases, to prevent the too weighty tax of a separate
table. We breakfast every morning at nine o’clock on Gloucester cheese
(taken out of an English prize) good brown bread, called pain d’egalité,
which they bake on board, and a thin acid claret, of which the Frenchmen
drink very liberally. This does not seem to argue the scarcity of flour among
them, which has been so much insisted upon in England. A hint of this was
dropped, and great derision followed, on their part, at the idea of starving
such a country as France, by cutting off a few casual supplies by sea. We
dine between twelve and one, and sup between six and seven o’clock. On
all these occasions there is a sufficient quantity of provisions provided,
though the dirty state in which it is served up, would disgust a Hottentot. I
have mentioned before, that during our meals we are surrounded by filthy
ragged cabin-boys, whose appearance, contentions and impertinence, are
intolerable. Among this crew of little blackguards, two were pointed out to
me as the son and nephew of Delcher, who is one of the representatives
from the Western Pyrenees to the convention. It is certain, that when I
challenged the boys with it, they confirmed it to me, and seemed to glory in
their situation. I was also shown a third boy, about eleven years old, who is
the son of an emigrated nobleman. In him, nature is not quite subdued: “Le
petit —— pleure quelquefois,” said one of the lieutenants to me.
I have forgotten to mention before, that on the day of our being brought
on board the Marat, we were shown their furnace (which is the oven) for
heating shot. It is well contrived, and the balls, by means of a pair of
bellows, would soon be made red-hot; but I doubt not that “even-handed
justice” will oftener render this dreadful implement of destruction, like “the
ingredients of the poisoned chalice, rather the plague of the inventor,” than
the destroyer of the objects of its vengeance. The motion of a ship at sea
must, I apprehend, not only cause its effect to be very precarious, but its use
very dangerous. Be this as it may, every thing here was prepared, the
faggots were laid, and the shot were placed between them; and they assured
us, that in the moment we had struck, they were just going to heat them for
us: a confession which, considering the odds that we had fought against,
was not very honourable to republican gallantry. All their ships of war, they
told us, were provided with similar furnaces.
In the little time I have been in my new situation, nothing has surprized
me more than the quantity of English articles I every where observe. The
cheese, as I said before, was Gloucester; to which I might have added, that
the plates it was served upon were Stafford, and the knives it was cut by
were Sheffield, while the coats, hats, and shoes of those who were eating it,
were also chiefly of British manufactures. “Prize, prize,” is the only answer
we receive to our enquiries. Surely what one of their officers told me cannot
be true! Seeing me just now looking up one of the arms which help to form
this capacious port, and which is crowded with shipping, he assured me that
they were all English, and not less than 400 in number. It is too well
ascertained, that the French have been, during the present war, wonderfully
successful against our trading vessels. Their frigates, I am informed, cruize
in small detached squadrons to the westward of Europe; whilst we confine
ours almost totally to the Channel, which I presume to consider a very
injudicious disposition of them, in a war wherein the enemy have no
privateers, and when consequently the little ports on the French coast,
within Ushant, should be less objects of our jealousy than heretofore.
Provided our grand fleet can, after a parade off Brest, return into Spithead
or Torbay, without being materially damaged by the weather, we seem to be
satisfied, and conclude that all is going on well on the waters.
How I shall be able to procure money for bills on London, during my
probable term of residence in this country, is not the smallest of my
inquietudes. I have hinted the difficulty to Captain Le Franq; but from his
real or assumed ignorance, one might be led to suppose, that paper-money
had always been the only currency of France. The little cash I had by me, I
took care to secure in my pocket, which escaped unsearched. It is, however,
very inadequate to administer to my wants, stripped as I am almost to my
last shirt. Small as it is, something like an attack was made upon it just now.
An old militaire, who is captain of the troops on board, came to me, and,
with many professions of esteem, offered to serve me, by giving me, in
exchange for English guineas, twenty-four livres in paper, each; assuring
me that I should subject myself to disagreeable consequences, by offering to
purchase with gold, when I might land. He brought the assignats in his hand
to tempt me: but I begged leave, with a profusion of compliments, to
decline this courteous proposal. Surely gold and assignats cannot be
deemed by all Frenchmen of equal value! Nous verrons! At present all is
mystery to me.—This said captain has a son on board, a fine youth, who is
a corporal in his father’s company.
Admiral Bligh is gone on shore to-day with the French captain, in order
to be taken before the representatives on mission here. He will probably
gain some intelligence of what we are destined to, and we expect his return
with impatience. We are too well acquainted with his feelings and
sentiments, to doubt that he will hesitate to sacrifice even his own personal
comforts to promote ours, and to prevent our being separated from him.
Upon surrendering our swords we were given to understand, that they
should be restored to us, agreeably to the usages of war among civilized
nations, but nothing has been lately said of this restitution; and the French
officers, on being asked about it, only shake their heads, and plead
ignorance.—How unlike the polished generality which once distinguished
Frenchmen towards enemies, who, in submitting to the imperious necessity
of war, yielded up arms without a stain!—— Adieu!
LETTER II.
Normandie, prison-ship, in
Brest-Water, 1st Dec. 1794.

I MUST continue to write on to you, as if I had the means of regularly


transmitting my letters. In the horrid dungeon in which I am now
immured, it forms my only consolation to talk to you, although you
cannot hear me; and to complain to you, although you cannot succour me.
Two days after the date of my first letter, we were all, except Admiral
Bligh, sent from Le Marat, on board this prison-ship. Such a change did not
much surprize us; for the reception which the Admiral experienced from the
representatives, was so cold and mysterious, as to afford neither intelligence
nor consolation; and Le Franq, who was his introducer and interpreter,
affected utter ignorance of their intentions towards us.
Our situation here is extremely irksome. The captain of the vessel and
his lieutenants are men of ferocious manners and brutal behaviour, high-
flying patriots, whose supreme delight consists in blaspheming all revealed
religion, and in abusing the English nation. In the day-time we have
nominally the liberty of walking upon the deck; but this privilege is
frequently so curtailed, by the caprices of our gaolers, as to amount almost
to a prohibition. At night we are crowded into a small cabin, and hardly
allowed light enough to undress ourselves by. Luckily, however, I have
recovered my mattress and a couple of blankets. We eat with the officers of
the ship, who are allowed a traitement, or table-money, of three livres six
sols a day, besides a ration of provisions, for each of us; so that the fault
does not seem to be imputable to the government. But either the markets of
Brest are extravagantly dear, or these patriotic gentlemen make an
advantage of us; for hardly a day passes in which we have a sufficiency of
any thing but coarse brown, or rather black, bread, so full of sandy particles
as to be almost uneatable. Our breakfast at first was bread and butter, and a
small red wine; but of late the butter has been taken away, and either
Newfoundland salt-fish, or salt herrings, substituted in its place. These,
indeed, are petty grievances, which would be easily tolerated, were they not
incessantly aggravated by the disagreeable tempers, and debased
sentiments, of those with whom we are obliged to live and converse. We are
surrounded by American vessels, but cannot hold with any of them the
smallest communication. A hope of hearing from England, or of conveying
aught to it, must not be indulged. We have been told, that if we choose to
venture the experiment of sending open letters by the post through
Switzerland, we may do it; but that they must be first taken to the
representatives, who will order them to be read, and forward them, if they
contain information of a private nature only. This precaution is reasonable
enough; but I have been assured by an officer of the ship, who is in a civil
capacity, that I may spare myself the trouble of sending any, for that to his
knowledge they are always thrown aside, and forgotten, in the office to
which they are carried. The number of prisoners on board is about four
hundred, nearly all of whom are English; and three more vessels
appropriated to a similar use, which also seem quite full, are moored close
to us. On the return of some frigates from a cruize, a few days since, we
received an accession to our number which surprized me:—twenty
emigrants—who for the crime of being Englishmen were taken out of an
American ship at sea, after which the vessel was suffered to proceed on her
voyage to Philadelphia, and the rest of the cargo remained unmolested.
I find that I acted prudently in not parting with my guineas. Since I have
been here, my brother-officer from Le Marat has honoured me by a second
visit, and offered thirty livres for a guinea, pointing out one of the serjeants
of the guard, through whom the business might at any time be transacted. I
again begged permission to decline this benevolent gentleman’s proposal,
and also two others of a similar tendency, which were made to me here. Nor
did the event deceive my expectation; for to-day a little Jew, who mounts a
cockade, and belongs to a frigate in the harbour, came on board, and
secretly gave me two hundred and fifty livres for five guineas, declaring it
to be the market price on shore. What think you of these specimens of
republican honour and delicacy to children of misfortune, like us? I was so
transported by indignation at those who had thus endeavoured to cheat me,
that I could not help asking them, on their attempting to renew the subject,
if the law did not forbid the depreciation of paper, when bartered for gold.
This regulation, they pretend, relates to French gold only. To exchange a
louis for more than its nominal value in assignats were criminal: but mark
the curious distinction! An English guinea, and a Portugueze johannes, are
articles of merchandize, whose worth depends on the election of the buyer.
Well! I have yet four English guineas left! Let me look at them! Oh “ye
ever-young, loved, and delicate wooers! whose blush doth thaw the
consecrated snow on Dian’s lap,”—and before whom even the sternness of
modern republican virtue melts into thin air,—tenaciously will I treasure ye
up!——Adieu!
LETTER III.
Normandie, prison-ship, Brest
Water, 7th Dec. 1794.

A DMIRAL BLIGH has been allowed to visit us twice or thrice since our
separation took place. He still remains on board Le Marat, with his son,
a little boy of ten years old, and two young midshipmen, who are also
permitted to be with him. Until this day he has been unable to give us any
information, and was even ignorant of what was to be his own lot. He is
now promised to be sent, on his parole, to Quimper, in Bretagne; and in
addition to innumerable proofs of kindness and regard, which I have
experienced from him ever since I have been under his command, he has
honoured me by obtaining leave for me to accompany him, as his aid-de-
camp and interpreter. Since my last letter he has been on board La
Montagne, to see Vice Admiral Villaret de Joyeuse, the commander in chief
of the fleet here, and who acted in that capacity against Lord Howe on the
first of June. He told me that he was very politely received, and was pressed
to accept of pecuniary assistance, which he declined; but Admiral Villaret
plainly hinted to him, that he was obliged to suppress much of the regard
which he wished to show to him, from the delicacy of his situation, in the
present temper of the times. Monsieur Renaudin, late commander of the
Vengeur, who was taken, after the sinking of his ship, on the first of June,
and is just returned from England, has visited him on board Le Marat. This
gentleman declares, in loud terms, the humanity of the English, and the
polite attentions he received from many of our most distinguished naval
officers, whose generosity left him no want: Of this list I remember the
names of Lord Howe, Admiral M‘Bride, Captain Bentinck, and Captain
Schomberg. Monsieur Renaudin also made a tender of his purse to Admiral
Bligh; but I have reason to believe, that it was not done with that explicit
frankness, which could hope to supersede the offer of Monsieur Villaret,
even had it been made previously to it. By the way, the re-appearance of
Renaudin, does not a little astonish the French; for the convention, in order
to gratify the national vanity, and inflame the minds of the people against
the English, had publickly announced, that Le Vengeur, with all her crew,
sunk with colours flying, disdaining to accept of quarter from slaves whom
they despised; and a decree was even passed, to perpetuate this heroic
resolution, by erecting a monument to the memory of the event.
I am sorry to say, that Monsieur Renaudin echoed the profession of his
commander in chief, in lamenting that the political prejudices which reign
here will prevent him also from acting up to the extent of his wishes, in
attending to the English, and the Admiral in particular. What evils do not
these political phrenzies generate? Be this as it may, I am all alive at the
thought of the scene about to burst upon me; and there are moments when I
am almost tempted not to regret a captivity, which opens an inlet into this
extraordinary country at such a period as the present; but these momentary
illusions flit before the memory of the scenes I have left behind. Can
curiosity, all-powerful as it is, stand in opposition to love and friendship?
Let me, however, but quit La Normandie, and then we will strike the
balance. To-morrow I am to bid adieu to her darksome round: how joyfully!
And yet I shall not leave without a tear of commiseration those gallant
comrades, with whom I have so lately fought, and so severely suffered.
The few remarks I have been able to make are entirely nautical. I shall
detail them to you when I can revise them at my leisure at Quimper. From a
fear of being searched, I have used some extraordinary precautions to
secure them; and if they be found they will not be easily understood, for I
have so transposed the natural order of the sentences, and so intermixed
words from all the languages which I could recollect (not excepting that of
New Holland) that it would puzzle the interpreter of the convention to
decypher them.—— Adieu.
LETTER IV.
Le Marat, Brest-Water,
15th Dec. 1794.

T HAT leisure which I so lately looked forward to at Quimper, seems


likely to be afforded to me here. I was removed from the prison-ship on
the 8th instant, and allowed to bring my servant with me, expecting to
be sent immediately on parole; but this event, like the resolutions of the
Dutch councils, seems to be put off ad referendum. We receive daily
assurances that it is to take place, and are daily disappointed of seeing it
arrive. I enjoy, however, the society and conversation of the Admiral; and as
he does not speak French, I am the chief medium through which he
communicates with those who surround him, Captain Le Franq, who is
married, living almost entirely on shore. So that here I remain, with nothing
to do but to ask and answer questions from morning to night. These are
chiefly nautical; and as you know my sentiments on the consequence of all
naval concerns to Englishmen, I am induced to believe you will concur with
me in thinking the subject momentous, however trite the remarks, or
unimportant the observations of your correspondent may prove.
Whether Selden’s assertion, that “we have an hereditary uninterrupted
right to the sovereignty of our seas, conveyed to us from our earliest
ancestors, in trust for our latest posterity,” be perfectly deducible either
from the nature of things, or from the authority of history, I shall not stay to
enquire. But I will venture to affirm, that when we suffer this right, however
acquired, to depart from us, the sun of England may be truly said to be set
for ever.
When the question of the relative naval strength of the two nations is
agitated, which it often is, I am tempted to cry out to my country, in the
words of the Grecian oracle,—“Trust to your wooden walls.”—I am the
more confirmed in this opinion, from reading every day in the bulletins of
the astonishing successes of this people, both in the Pyrenees, and on the
frontier of Holland. They openly boast of being able, in a short time, to
penetrate to Madrid; to force the German powers to peace; and to totally
subdue the Dutch.—And then “Delenda est Carthago.” I accuse not those
with whom I converse of using this, or any other Latin phrase; but you will
smile on being told that they habitually call us Carthaginians, and
themselves Romans. They pay us, however, the compliment of declaring,
that we are the only enemies worth combating. They stigmatize the
Spaniards as cowards: at German tactics, when opposed to the energy and
enthusiasm of republicans, they laugh: Dutch apathy can alarm no one. But
this respect is confined to our naval character. Our impotent interference
and puny attempts on the Continent they treat only with ridicule and
derision. This spirit is not new: A noble lord, now high in rank in the British
army, told me nearly twenty years ago, when we were on service together in
America, that when he was very young, and travelling in France, a general
officer, on hearing him relate that he was designed for the army, expressed
his surprize that any Englishman, to whom the choice was left, should
hesitate to prefer entering into the navy. Are the scorn and contempt of our
enemies necessary to teach us in what our true grandeur, our real national
pre-eminence, consists? It is certain that at present we far surpass them in
the number of our ships, in the dexterity of our seamen, and in the interior
regulations of our service; but I am persuaded, that they will hereafter strain
every nerve to equal and exceed us. I know, that by very high authority the
naval power of France has been denominated “forced and unnatural;” but
let those who apply to it epithets so devoid of knowledge and reflection,
remember the short period in which Louis XIV. created this navy, and its
resurrection in 1778, when, to the astonishment of all Europe,
notwithstanding its wasted and disastrous condition but fifteen years before,
it suddenly started up, singly, to contest the empire of the sea with Britain,
and for four years (until the 12th of April 1782) poised the scale of victory
against its formidable antagonist.
Nature has denied to France a port in the Channel, capable of receiving
large ships; but if art can supply the deficiency, they seem determined to
employ it to its utmost extent. Whether the works at Cherbourg are
proceeding or not, I cannot exactly learn; but it is certain, that the scheme of
rendering it secure for line of battle ships is not utterly abandoned; and who
can doubt, that it will either be carried on there, or in some neighbouring
port, with accelerated vigour, on a return of peace? Their warlike spirit now
runs so high, and is so universally diffused, that many years must elapse ere
it will subside. It is a train of gun-powder, to which, in the present temper of
the people, a spark will give fire. A hatred of England is fostered with
unceasing care. In nothing does this inveterate spirit against us demonstrate
itself so bitterly, as in the abhorrence with which they always mention our
taking possession of Toulon: “You gained it like traitors; you fled from it
like poltroons.” On the celebrated measure of making them a present of four
ships of the line, and six thousand of their best seamen, which were sent to
Brest and Rochfort from the Mediterranean, they often make themselves
merry, and us serious, by pointing out the ships as they now lie near to us,
equipped and ready for sea; and by affirming, that the supply of men thus
received enabled them to fit out those cruizing squadrons which have so
sorely distressed our commerce.
How incumbent upon us, then, is it become to guard against the effects,
which a propagation of this principle will inevitably produce! Naval
perfection is, I am well aware, like all other perfections, placed beyond
human reach; but the road to excellence is open. In it we have advanced
before our rivals in all branches of naval superiority but one: I mean ship-
building. Our vessels want length, and in the construction of their bottoms
are undeniably very inferior to those of our enemies. Hence the continual
escapes of the French fleets from ours, by superior sailing, when we want to
bring them to action, which no skill, diligence, or bravery in our
commanders can surmount. We possess models from which we might learn
to correct our errors, and supply our deficiencies; but these patterns we are
more ready to destroy than to imitate, as if fearful lest comparison of them
with our own productions should demonstrate our inferiority. Thus do we
continue obstinately to grope on in a dark and superannuated track, merely
because our ancestors preceded us in it. The truth is, the art of ship-building
has been cultivated in France by men of science, enlightened by a previous
study of its theory: whereas in England it has been committed to the
management of those, who for the most part have certainly had no room to
boast of a scientific education, or a laborious examination of principles; and
who could justly lay claim to the merit of observation only. In a country so
eminent for mathematical acquirements as ours, is it not extraordinary, that
this most useful branch of knowledge should have been so rarely applied to
national advantage? What treatises on this important subject can we oppose
to those, which have been published by French academicians, and by
Bouguier in particular?
“Oh! for a bridge to pass over two hundred thousand sans-culottes!” I
hear often exclaimed. Not that bridge which, according to Milton, Death
consolidated across Chaos, could be more fatal to the remaining innocence
of our first parents, than such a structure, in the shape of a superior fleet,
would prove to their English descendants. To prevent its erection, or to have
a chosen band of pioneers ready to destroy it, must be our concern. I am,
however, well convinced, that hitherto they have never seriously intended to
invade us. This bug-bear has now for more than a century been employed to
affright us; to cramp our foreign efforts; to diminish our sum of productive
labour, one of the most important of national considerations; and to debauch
the manners of our artisans and peasants in camps and barracks[D].
I have been curious to hear their account of the signal defeat, which they
experienced on the first of June. This ship was not in their fleet, having
been launched since; but Captain Le Franq commanded on that day
L’Entreprenant, of 74 guns, and some of the other officers were also parties
concerned. Not the invincible superiority of British seamen in fighting and
managing their ships, but “Treason! treason! joined to the ignorance,
obstinacy, and cowardice of Jean Bon St. André, caused the loss of the day.”
This naval dictator, who from a Hugonot curate at the foot of the Pyrenees
was raised to be a member of the convention, and delegated by that body to
superintend the equipment, and direct the manœuvres, of a great fleet, is
never mentioned but with execration. His star set with that of his master,
Robespierre. I have heard an officer assert, that he saw him, in the heat of
the engagement, seized with a sudden emotion, start from Admiral Villaret,
near whom he was standing, in the stern-gallery of La Montagne, and run
pale and breathless down to the lower gun-deck, under a pretence of
encouraging the men; nor could he be drawn thence, until the danger was
over. “His seamanship,” continued this gentleman, “consisted in having
made one short passage. He might be a good ecrivain ou secretaire; but for
the marine! Oh! le vilain——!” But for him, they say, the action would have
been renewed, agreeably to the wishes and representations of Monsieur
Villaret; for “the English were beaten, and might have been destroyed.”—I
cannot help thinking, that if Jean Bon St. André really did prevent a renewal
of the battle, he is not altogether so obnoxious to the reproaches of his
fellow-citizens as they describe him to be, France is not the first republic
which has profited, by declining to combat a victorious enemy.—A second
cause of the disaster of the day arose from Lord Howe having gained
possession of a copy of the French signals, which was procured by “the
guineas of Pitt;” so that he was enabled to divine all their intentions, and to
counteract them. It is certain, that some of their captains were gullotined,
after the return of the fleet to Brest, but whether on a suspicion of
cowardice, or perfidy, I know not. How consolatory to French vanity are
these satisfactory solutions of this dreadful overthrow! Happy people! who,
in all your conflicts against other nations, conquer by superior skill and
bravery only; and are never vanquished but by disparity of number on the
side of your enemy, or by treachery among yourselves!
An error, which you with myself, and all other Englishmen, have fallen
into about this engagement, I must beg leave to correct, or at least to offer
you my reasons for believing it to be one.—Lord Howe’s account of the
action states, that two ships of the enemy were sunk. Of Le Vengeur we will
not speak; here proof is positive. But I am persuaded she was the only one.
This the French positively assert; and I beg leave so far to join with them,
as to observe, that when in Admiral Montagu’s squadron (of which the
Alexander formed a part) we were chased, on the ninth of June, by the
shattered remnant of their fleet, which was steering to Brest, it was
composed of nineteen sail of the line. Now, I apprehend it to be certain, that
on the day of battle this fleet consisted but of twenty-six ships, six of which
were captured and brought into England; so that it should appear the
seventh, Le Vengeur, made up the original number. But beside the strong
presumption which this circumstance affords, I have received assurances
from so many quarters (and particularly from one not remarkably friendly
to the present system) that I am convinced one ship only was sent to the
bottom on the first of June. Indeed, in matters of this nature, owing to the
passions of those engaged, and the innumerable causes which obstruct
vision, we should always receive similar relations cum grano salis. In Lord
Rodney’s action of the 12th of April 1782, a French ship, said to be Le
Diademe, was supposed to be sunk; but I believe subsequent accounts
clearly evinced that such an event did not happen. However, the French are
more than even with us upon this head; for I have heard some of them
positively affirm, that they saw three, and others four of our ships, among
which was the Queen Charlotte, go down on the first of June. And when I
assured the gentleman who furnished me with this last piece of information,
“on the evidence of his own senses,” that he had been deceived, he only
shook his head, and continued, like your friend, a sceptic.
The remainder of this letter shall be dedicated to a detail of those
detached parts of their naval institutions, customs, and present state, which I
have been enabled to pick up. In general I think them inferior, because less
easily practicable, to our own, but many of them deserve consideration.
“Fas est et ab hoste doceri.”
The discipline of their men struck me at the first view as contemptible;
and yet I must confess that I was surprized by the state of subordination in
which I afterwards found them. The seaman or soldier addresses his
commander by the title of Citoyen, and receives in return the same
appellation; but in the five weeks I have lived among them, I have
witnessed only one instance of disobedience. The offender was a soldier,
who refused to assist in performing some of the ordinary duties of the ship.
A court-martial, or conseil de discipline as they call it, was immediately
holden upon him, by order of Captain Le Franq, who prosecuted. It
consisted of a lieutenant of the ship and three seamen, and of two serjeants
and a corporal of the troops. The prisoner pleaded ignorance of the law on
this head; and that when he had voluntarily enrolled himself to serve as a
soldier, it was under an idea of not being compelled to do that which ought
to be the result of inclination only. This defence was deemed so
unsatisfactory, that the offender was sentenced to three months
imprisonment on shore.
All the judicial institutions of their navy, and the punishments allowed to
be inflicted, as well as the cases to which they apply, are strictly defined.
The conseil de discipline is impowered to try only inferior officers and men.
The officers of the état major (answering nearly to those of our ward-room)
and all above them, can be tried only by a board of officers, who assemble
in the admiral’s ship. Neither of these courts has the power of condemning
to death: all offences of a capital nature must be tried before the
revolutionary tribunal. The punishments enjoined are flogging in certain
cases, the number of lashes being limited; running the gantlope; ducking
from the yard-arm; confinement on shore, or in the lion’s den (boatswain’s
store-room); stoppage of pay; and degradation. The three last extend to
officers. A prisoner’s allowance of wine is always stopped. No man can be
punished but by a sentence of the conseil de discipline; and, in carrying on
the service of the ship, it is positively directed, that no “French citizen”
shall, on any account whatever, be struck; but he may be pushed as
violently as may be found necessary. For giving a box on the ear an officer
would be cashiered; but to dash a man’s head against the ship’s side, so as
to crush his nose, or beat out his teeth, by rushing suddenly upon him, is
allowable.
The ranks of officers differ from ours: those only who command line-of-
battle ships, and frigates carrying 18-pounders, are properly styled captains.
Other frigates are commanded by lieutenants; and vessels of 20 guns or
under by ensigns. Common courtesy, however, with them, as with us,
annexes the title of Captain to all commanders. Agreeably to this
classification the pay is regulated, but it is at present found so grievously
inadequate, as to cause great complaints; and yet the French are unanimous
in affirming, that all ranks are not only better paid, but better fed, clothed,
and treated, than under the old government. Besides his pay, every officer,
including the warrant officers and midshipmen, is allowed a traitement, in
lieu of the table which was formerly kept at the king’s expence. The
traitement of admirals and captains is very handsome, and suited to their
rank, as they are enjoined to keep separate tables: that of Captain le Franq is
24 livres a day. No half-pay has yet been settled upon, or even promised to,
the French officers. The seamen are divided into four classes: the pay of the
highest class is 40½ livres a month; of the second 36½; of the third 33½;
and of the lowest 30½.
Their gradations of command are very similar to our own, from the
captain to the lieutenants, ensigns, and boatswain. The office of pilote,
which formerly answered to that of master with us, is abolished. It is
particularly enjoined, that the officers be put at five watches, if the state of
the ship will allow of it. The lieutenant of the watch is stuck up on a little
pedestal, which overlooks the helmsman, whence, except in emergencies,
he never stirs during his guard, the ensign appointed to assist him, who is
distinguished by wearing a gorget, being charged to superintend the
execution of his orders.
The general uniform of both their navy and army is a blue coat, with a
red waistcoat and breeches: the naval facing is white edged with red, and
that of the soldiery red; both services wear gold epaulettes. The naval
button is an anchor, surmounted by the cap of liberty, and encircled by the
words “La République Française.”
Of the minute regulations established for dividing prize-money, I cannot
speak; but the general principle on which its distribution is founded appears
to me worthy of attention. Two-thirds of every prize are put into a common
stock, which is shared by the whole navy, and the remaining third is divided
among the captors. A captain receives but in a proportion of 5 to 1 to a
foremast-man; a captain of troops, and a naval lieutenant, as 4 to 1; a naval
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!

textbookfull.com

You might also like