Deep Learning with Python 2nd Edition Nikhil Ketkar download pdf
Deep Learning with Python 2nd Edition Nikhil Ketkar download pdf
com
https://ebookmeta.com/product/deep-learning-with-python-2nd-
edition-nikhil-ketkar/
OR CLICK BUTTON
DOWNLOAD NOW
https://ebookmeta.com/product/deep-learning-with-python-1st-edition-
nikhil-ketkar/
ebookmeta.com
https://ebookmeta.com/product/fundamentals-of-deep-learning-nikhil-
buduma/
ebookmeta.com
https://ebookmeta.com/product/accounting-for-goodwill-and-other-
intangible-assets-1st-edition-mark-l-zyla/
ebookmeta.com
Beautiful Fiend An enemies to lovers dark romance North
Shore Stories Book 1 1st Edition Lola King
https://ebookmeta.com/product/beautiful-fiend-an-enemies-to-lovers-
dark-romance-north-shore-stories-book-1-1st-edition-lola-king/
ebookmeta.com
https://ebookmeta.com/product/john-locke-and-agrarian-capitalism-neal-
wood/
ebookmeta.com
https://ebookmeta.com/product/the-battle-for-syria-international-
rivalry-in-the-new-middle-east-christopher-phillips/
ebookmeta.com
https://ebookmeta.com/product/fangs-for-the-memories-haunted-singles-
weekend-1st-edition-banks-tamrin/
ebookmeta.com
https://ebookmeta.com/product/50-strategies-for-teaching-english-
language-learners-adrienne-l-herrell-michael-jordan/
ebookmeta.com
Unit Cohesion and Warfare in the Ancient World Military
and Social Approaches 1st Edition Joshua R. Hall
https://ebookmeta.com/product/unit-cohesion-and-warfare-in-the-
ancient-world-military-and-social-approaches-1st-edition-joshua-r-
hall/
ebookmeta.com
Nikhil Ketkar and Jojo Moolayil
Deep Learning with Python
Learn Best Practices of Deep Learning Models with
PyTorch
2nd ed.
Nikhil Ketkar
Bangalore, Karnataka, India
Jojo Moolayil
Vancouver, BC, Canada
Apress Standard
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.
The publisher, the authors and the editors are safe to assume that the
advice and information in this book are believed to be true and accurate
at the date of publication. Neither the publisher nor the authors or the
editors give a warranty, express or implied, with respect to the material
contained herein or for any errors or omissions that may have been
made. The publisher remains neutral with regard to jurisdictional
claims in published maps and institutional affiliations.
—Nikhil Ketkar
—Jojo Moolayil
Table of Contents
Chapter 1:Introduction to Machine Learning and Deep Learning
Defining Deep Learning
A Brief History
Advances in Related Fields
Prerequisites
The Approach Ahead
Installing the Required Libraries
The Concept of Machine Learning
Binary Classification
Regression
Generalization
Regularization
Summary
Chapter 2:Introduction to PyTorch
Why Do We Need a Deep Learning Framework?
What Is PyTorch?
Why PyTorch?
It All Starts with a Tensor
Creating Tensors
Tensor Munging Operations
Mathematical Operations
Element-Wise Mathematical Operations
Trigonometric Operations in Tensors
Comparison Operations for Tensors
Linear Algebraic Operations
Summary
Chapter 3:Feed-Forward Neural Networks
What Is a Neural Network?
Unit
The Overall Structure of a Neural Network
Expressing a Neural Network in Vector Form
Evaluating the Output of a Neural Network
Training a Neural Network
Deriving Cost Functions Using Maximum Likelihood
Binary Cross-Entropy
Cross-Entropy
Squared Error
Summary of Loss Functions
Types of Activation Functions
Linear Unit
Sigmoid Activation
Softmax Activation
Rectified Linear Unit
Hyperbolic Tangent
Backpropagation
Gradient Descent Variants
Gradient-Based Optimization Techniques
Practical Implementation with PyTorch
Summary
Chapter 4:Automatic Differentiation in Deep Learning
Numerical Differentiation
Symbolic Differentiation
Automatic Differentiation Fundamentals
Implementing Automatic Differentiation
Summary
Chapter 5:Training Deep Leaning Models
Performance Metrics
Classification Metrics
Regression Metrics
Data Procurement
Splitting Data for Training, Validation, and Testing
Establishing the Achievable Limit on the Error Rate
Establishing the Baseline with Standard Choices
Building an Automated, End-to-End Pipeline
Orchestration for Visibility
Analysis of Overfitting and Underfitting
Hyperparameter Tuning
Model Capacity
Regularizing the Model
Early Stopping
Norm Penalties
Dropout
A Practical Implementation in PyTorch
Interpreting the Business Outcomes for Deep Learning
Summary
Chapter 6:Convolutional Neural Networks
Convolution Operation
Pooling Operation
Convolution-Detector-Pooling Building Block
Stride
Padding
Batch Normalization
Filter
Filter Depth
Number of Filters
Summarizing key learnings from CNNs
Implementing a basic CNN using PyTorch
Implementing a larger CNN in PyTorch
CNN Thumb Rules
Summary
Chapter 7:Recurrent Neural Networks
Introduction to RNNs
Training RNNs
Bidirectional RNNs
Vanishing and Exploding Gradients
Gradient Clipping
Long Short-Term Memory
Practical Implementation
Summary
Chapter 8:Recent Advances in Deep Learning
Going Beyond Classification in Computer Vision
Object Detection
Image Segmentation
Pose Estimation
Generative Computer Vision
Natural Language Processing with Deep Learning
Transformer Models
Bidirectional Encoder Representations from Transformers
GrokNet
Additional Noteworthy Research
Concluding Thoughts
Index
About the Authors
Nikhil Ketkar
currently leads the Machine Learning
Platform team at Flipkart, India’s largest
ecommerce company. He received his
PhD from Washington State University.
Following that, he conducted
postdoctoral research at University of
North Carolina at Charlotte, which was
followed by a brief stint in high-
frequency trading at TransMarket in
Chicago. More recently, he led the data
mining team at Guavus, a startup doing
big data analytics in the telecom domain,
and Indix, a startup doing data science in the ecommerce domain. His
research interests include machine learning and graph theory.
Jojo Moolayil
is an artificial intelligence professional
and published author of three books on
machine learning, deep learning, and IoT.
He is currently working with Amazon
Web Services as a Research Scientist –
A.I. in their Vancouver, BC office.
In his current role with AWS, Jojo
works on researching and developing
large-scale A.I. solutions for combating
fraud and enriching the customer’s
payment experience in the cloud. He is
also actively involved as a technical
reviewer and AI consultant with leading
publishers and has reviewed over a
dozen books on machine learning, deep
learning, and business analytics.
You can reach Jojo at:
https://www.jojomoolayil.com/
https://www.linkedin.com/in/jojo62000
https://twitter.com/jojo62000
Other documents randomly have
different content
The Project Gutenberg eBook of Letters from the
peninsula, 1808-1812
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.
Language: English
From the miniature by J.C.D. Engleheart in the possession of the Rev. Canon
Warre
1808
CHAPTER I
Portsmouth, May 22 3
H.M.S. Resistance, St Helens, May 24 4
Cove, June 8 5
Cove, June 17 8
Cove, June 22 11
Cove, June 27 41
1808
CHAPTER II
Porto Roads, July 25 19
Off Ovar, Monday evening, July 25 20
Camp Lavos, near Figueira, Aug. 8 21
Lourinhao, 12 miles south of Peniche, Aug. 19 24
Vimiero, Aug. 22 25
Buenos Ayres, Lisbon, Sept. 27 28
Lisbon, Sept. 29 36
1808-9
CHAPTER III
Avanilla, near Sahagun, 5½ leagues from Saldaña, half-past
5 p.m., Dec. 23, 1808 46
Sobrado, between Lugo and St Jago, Jan. 4, 1809 48
Barfleur, at sea, Jan. 18 50
Plymouth, Jan. 23 51
Lisbon, March 3 53
Lisbon, April 1 56
Undated (?) April 7 59
Headquarters, Thomar, April 27 60
Lisbon, July 13—arrived Aug. 24, per Colonel Brown 66
Lacebo, Aug. 10—Los Hoyos, Aug. 13 68
Salvaterra, Aug. 18—Castello Branco, Aug. 20 71
Headquarters, Lisbon, Sept. 6 77
Headquarters, Lisbon, Sept. 11 81
Lisbon, Sept. 25 85
Lisbon, Oct. 10 86
Lisbon, Oct. 26 90
Lisbon, Oct. 26 93
Lisbon, Dec. 1 95
Thomar, Dec. 31 97
1810
CHAPTER IV
Lisbon, Feb. 6 104
Lisbon, Feb. 17 108
Lisbon, March 10 112
Coimbra, March 21 115
Coimbra, March 30 117
Headquarters, Mango Aide, May 3 119
Fornos d’Algodres, May 9 (extract from letter to Sister) 123
Headquarters, Fornos d’Algodres, May 15 125
Headquarters, Fornos d’Algodres, May 23 130
Extract (London, June 20), Fornos, June 6 132
Extract (Hendon, July 8), Fornos, June 13 133
Headquarters, Fornos d’Algodres, June 20 134
Headquarters, P.A., Francoso, near Pinhel, June 27 137
Francoso, July 9 139
Francoso, July 10 151
Francoso, July 25 154
Lagiosa, Aug. 8 156
Lagiosa, Aug. 22 158
Lagiosa, Aug. 29 162
Lagiosa, Aug. 29, 6 p.m. 166
Hendon Place, Oct. 2 167
Hendon Place, Oct. 16 (extract, news of Bussaco, Sept. 27) 168
Hendon Place, Oct. 25 (referring to letter Oct. 6) 169
Headquarters, P.A., Casal Eschin, a mile to the eastward of
Enxara dos Cavaleiros, 5 leagues from Lisbon, Oct. 20 171
Extract, Falmouth, Nov. 14 175
Extract, Honiton, Nov. 18 177
1811
CHAPTER V
Portsmouth, May 5 180
Portsmouth, May 7 181
Portsmouth, May 9 183
Headquarters, St Olaia, June 20 184
Headquarters, St Olaia, June 27 188
Headquarters, St Olaia, July 1 191
Lisbon, July 5 192
Lisbon, Aug. 2 192
Cintra, Aug. 17 195
Cintra, Aug. 23 198
Cintra, Sept. 7 202
Lisbon, Oct. 17 205
Lisbon, Nov. 23 209
Lisbon, Nov. 30 212
Lisbon, Dec. 6 213
Lisbon, Dec. 14 216
1812
CHAPTER VI
January to September
Torres Novas, Jan. 4 221
Coimbra, Jan. 10 222
Gallegos, Jan. 20 223
Elvas, March 6, extract 226
Elvas, March 18 229
Camp before Badajos, March 20 234
Camp before Badajos, March 29-(April 3), extract 235
Camp before Badajos, April 2 236
Badajos Camp, April 7 241
Camp before Badajos, April 10 247
Nava, on the road between Sabugal and Alfaiates, April 24 248
Fuente Guinaldo, May 20, extract 252
Fuente Guinaldo, May 28 254
Salamanca, June 17 258
Salamanca, June 25 262
Villa Escusa, Province of Toro, June 30 269
La Seca, Province of Valladolid, July 7 274
La Seca, July 10, extract 278
La Seca, July 13 279
Salamanca, July 24 284
Salamanca, July 27 292
Salamanca, Aug. 29, extract 295
(?) Salamanca, Sept. 2, extract 297
CHRONOLOGICAL TABLE OF
EVENTS
1807.
Nov. French Conquest of Portugal.
Nov. 30. Junot occupies Lisbon.
Portuguese Royal Family fly to Brazil.
1808.
May. Napoleon makes Joseph Buonaparte King of
Spain.
Outbreak of Spanish insurrection.
June. French invade Valencia and Andalusia.
Siege of Saragossa.
July 14. Battle of Medina del Rio Seco.
” 20. Capitulation of Baylen.
Aug. 1-4. Landing of British army in Portugal.
” 17. Combat of Roliça.
” 21. Battle of Vimiero.
” 30. Convention of Cintra.
Oct. Napoleon’s invasion of Spain.
Oct. 6. Sir John Moore takes command of British troops
in Portugal.
Nov. 13. Moore at Salamanca.
” 23. Battle of Tudela. Spaniards defeated.
Dec. 4. Napoleon arrives at Madrid.
” 15. Soult with 15,000 men at Saldaña.
” 20. Moore reaches Mayorga; junction with Baird.
” 21. Combat of Sahagun.
” 22. Napoleon’s pursuit of Moore begins.
” 23. Avanilla, near Sahagun, 5½ leagues from
Saldaña, half-past 5 p.m.—orders to march
on Saldaña, 6 p.m.; news received about 7
p.m. of Napoleon’s advance; Moore resolves
on and orders retreat.
” 28. Benavente.
” 29. Astorga.
” 31. Bembibre.
Napoleon leaves the pursuit to Soult and returns
to France.
1809.
Jan. Retreat of Sir John Moore’s army continued.
Jan. 2. Bembibre.
” 3. Villa Franca.
” 6. Rearguard finds army at Lugo in position.
” 8-9. Lugo evacuated.
” 9-10. Betanzos.
” 11. Corunna—no transports.
” 14. Transports arrive.
” 16. Battle of Corunna.
” 17. Embarkation completed.
” 18. H.M.S. Barfleur sails from Corunna.
” 23. Arrives Plymouth.
Feb. 20. Fall of Saragossa.
Feb. (end). Beresford appointed to command Portuguese
army.
March (early). Beresford arrives at Lisbon.
March 10-20. Soult’s operations in Portugal; capture of Oporto.
” 29. Battle of Medellin—Spaniards defeated.
April 22. Sir A. Wellesley arrives in Lisbon.
May 12-22. Oporto retaken; Soult’s retreat to Orense and
Lugo.
June. Advance of British army from Abrantes.
July 27-28. Battle of Talavera.
Aug. 4. Wellesley retires on Badajos.
Oct. 18. Battle of Tamames—French defeated.
Nov. 19. Battle of Ocaña—Spaniards defeated.
” 29. Battle of Alba de Tormes—Spaniards defeated.
1810.
Jan. Lord Wellington retires into Portugal.
Jan. and Feb. The French invade Andalusia.
Feb. 1. King Joseph enters Seville.
Siege of Cadiz.
” 12. Badajos summoned by Mortier.
March to April 22. Siege of Astorga.
May to July 9. Siege of Ciudad Rodrigo.
July 24. Combat of the Coa.
July to Aug. 27. Siege of Almeida.
Sept. 16. Masséna advances into Portugal.
” 27. Battle of Bussaco.
Oct. 1-9. Wellington retires within the lines of Torres
Vedras.
Oct. to Nov. Masséna before the lines.
Nov. 14. Masséna retreats to Santarem.
Dec. 21. Soult moves northward to support Masséna.
1811.
Jan. 27. Soult invests Badajos.
March 5. Masséna leaves Santarem.
” 11. Surrender of Badajos; Soult returns to the South.
” 15. Foz d’Aronce.
” 29. The Allies take Guarda.
April 3. Combat of Sabugal.
Masséna leaves Portugal.
” 20. Wellington to the Alemtejo.
May 2. Masséna resumes the offensive.
” 4. Beresford lays siege to Badajos.
” 5. Battle of Fuentes d’Onoro.
” 8. Masséna retreats; is removed from command.
” 10. Brennier escapes with garrison from Almeida.
” 12. Soult raises the siege of Badajos.
” 16. Battle of Albuera.
King Joseph leaves Madrid.
Marmont takes command of the army of
Portugal.
” 25. Reinvestment of Badajos.
June 12. Siege raised the second time.
The French retire from Estremadura.
Aug. 8. Wellington blockades Ciudad Rodrigo.
Sept. 21. Marmont advances to relieve Ciudad Rodrigo.
” 24. Action at El Bodon.
” 25-27. The Allies retreat, and take up position covering
the line of the Coa.
” 27. The French withdrawal—Marmont to Talavera,
Dorsenne to Salamanca.
Ciudad Rodrigo again invested.
The British army goes into cantonments on the
Coa.
Marmont concentrates near Toledo.
1812.
Jan. 8. Siege of Ciudad Rodrigo.
” 19. Taking of Ciudad Rodrigo by storm.
March 16. Siege of Badajos.
April 6-7. Taking of Badajos.
May 18. Hill destroys bridge at Almaraz.
June. Wellington advances into Castille.
June 17. Allies enter Salamanca.
” 27. Forts at Salamanca taken.
July 22. Battle of Salamanca—Beresford severely
wounded.
Aug. 12. Allies enter Madrid.
Sept. Siege of Burgos.
Oct. Retreat from Burgos.
Nov. Winter quarters near Ciudad Rodrigo.
MEMOIR OF WILLIAM WARRE
William Warre, the subject of this Memoir, was the eldest son of
James Warre of Oporto, and Eleanor, née Greg, his wife. He was
born at Oporto, 15th April 1784, and spent most of his childhood
there. He was sent to Harrow, but seems to have left early, and to
have been placed in the office of Messrs Warre & Co., of which his
uncle, William Warre, was the senior partner, in order that he might
learn the business which both his uncle and his father desired him to
follow.
But his own strong wish was to be a soldier, and, as it turned out,
a piece of mischief achieved that which arguments and entreaties
had failed to obtain. One day in the office, when letters had to be got
ready for the mail, the duty of sealing them, in which, after the
fashion of the day much wax, red or black, was consumed, devolved
upon the young clerk, who, observing that the pigtail of Pedro Alves,
the Portuguese member of the firm, had lapped over to his side of
the desk, while the old gentleman was enjoying a peaceful post-
prandial slumber, felt moved to play a practical joke, which had
momentous consequences. He poured the red wax upon the ribbon
of the pigtail, fastening it to the desk, sealed it with the seal of the
firm, and fled. Great was the wrath that ensued. No apologies could
be accepted. It was the end of his commercial career.
He was then sent to a private tutor at Bonn to learn foreign
languages, and to prepare for the Army. On the breaking out of the
war between France and Austria, he and another fellow-student
joined the Austrians, and went out, as they said, to see the fun. As
luck would have it, they were taken prisoners in a skirmish, and were
brought before General Custine, who commanded the French force
in the neighbourhood. Custine, seeing that they were English and
mere boys, scolded them and told them that it was very lucky for
them that Marshal Davoust had not arrived to take over the
command, “for,” said he, “he would have hanged you without mercy
on the nearest tree. Now go back to your books and your tutor, and
don’t meddle with affairs which do not concern you.”
Shortly after this William Warre was sent back to England, and on
the 5th November 1803, when he was 19 years of age, received his
commission in the 52nd Light Infantry, then under the command of
Sir John Moore. He served with the 52nd till 25th April 1805, when
he was promoted Lieutenant in the 98th, which was then in Canada.
He did not, however, proceed thither, having purchased promotion as
Captain in the 23rd Dragoons.
He served with this regiment in Ireland until the summer of 1807,
when he was sent to the Royal Military College, then established at
High Wycombe, to study for Staff employment.
In 1808 General Ferguson selected him as A.D.C., and took him
with him to Portugal. There he was present at the combat of Roliça,
and at the Battle of Vimeiro, both of which are described in his
letters. His health gave way under the hardships of this campaign,
and he was detained ill at Lisbon for several months. His knowledge
of the Portuguese language enhanced the value of his services, and
after his recovery, General Ferguson having returned to England, he
was attached by General Beresford to his personal staff, and served
with him as his principal A.D.C. until the year 1812.
Captain Warre took part in Sir John Moore’s retreat and, with
General Beresford, was the last to embark after the Battle of
Corunna, 16th January 1809.
In March 1809, Beresford, with the rank of Field-Marshal, was
placed in chief command of the Portuguese Army, and employed
Captain Warre, his A.D.C., in the organisation of the national troops.
He entered the Portuguese service and was promoted therein to the
rank of Major, and appointed first A.D.C. to the Field-Marshal.
After the passage of the Douro, May 1809, Major Warre was sent
forward by Beresford to raise the armed peasantry in the province of
Minho, with a view to harassing the French forces under Marshal
Soult, which were then in full retreat. He succeeded in getting the
peasantry to dismantle the bridges of Ponte Nova and the Saltador,