Full Deep Learning With Python Develop Deep Learning Models On Theano and TensorFLow Using Keras Jason Brownlee Ebook All Chapters
Full Deep Learning With Python Develop Deep Learning Models On Theano and TensorFLow Using Keras Jason Brownlee Ebook All Chapters
com
https://textbookfull.com/product/deep-learning-
with-python-develop-deep-learning-models-on-
theano-and-tensorflow-using-keras-jason-brownlee/
https://textbookfull.com/product/topological-geometrodynamics-an-
overview-matti-pitkanen/
textbookfull.com
https://textbookfull.com/product/teaching-secondary-school-
mathematics-research-and-practice-for-the-21st-century-geiger/
textbookfull.com
https://textbookfull.com/product/the-transnational-voices-of-
australias-migrant-and-minority-press-catherine-dewhirst/
textbookfull.com
https://textbookfull.com/product/childhood-cancer-a-parent-s-guide-to-
solid-tumor-cancers-third-edition-keene/
textbookfull.com
��������������������������������
����������������������������
�����
��������������
Jason Brownlee
Edition: v1.7
Contents
Preface iii
I Introduction 1
1 Welcome 2
1.1 Deep Learning The Wrong Way . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Deep Learning With Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Book Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Requirements For This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.5 Your Outcomes From Reading This Book . . . . . . . . . . . . . . . . . . . . . . 7
1.6 What This Book is Not . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.7 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
II Background 10
2 Introduction to Theano 11
2.1 What is Theano? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.2 How to Install Theano . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.3 Simple Theano Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.4 Extensions and Wrappers for Theano . . . . . . . . . . . . . . . . . . . . . . . . 13
2.5 More Theano Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3 Introduction to TensorFlow 15
3.1 What is TensorFlow? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.2 How to Install TensorFlow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.3 Your First Examples in TensorFlow . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.4 Simple TensorFlow Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.5 More Deep Learning Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4 Introduction to Keras 19
4.1 What is Keras? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.2 How to Install Keras . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.3 Theano and TensorFlow Backends for Keras . . . . . . . . . . . . . . . . . . . . 20
ii
iii
20.10Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Deep learning is a fascinating field. Artificial neural networks have been around for a long time,
but something special has happened in recent years. The mixture of new faster hardware, new
techniques and highly optimized open source libraries allow very large networks to be created
with frightening ease.
This new wave of much larger and much deeper neural networks are also impressively skillful
on a range of problems. I have watched over recent years as they tackle and handily become
state-of-the-art across a range of difficult problem domains. Not least object recognition, speech
recognition, sentiment classification, translation and more.
When a technique comes a long that does so well on such a broad set of problems, you have
to pay attention. The problem is where do you start with deep learning? I created this book
because I thought that there was no gentle way for Python machine learning practitioners to
quickly get started developing deep learning models.
In developing the lessons in this book, I chose the best of breed Python deep learning library
called Keras that abstracted away all of the complexity, ruthlessly leaving you an API containing
only what you need to know to efficiently develop and evaluate neural network models.
This is the guide that I wish I had when I started apply deep learning to machine learning
problems. I hope that you find it useful on your own projects and have as much fun applying
deep learning as I did in creating this book for you.
Jason Brownlee
Melbourne, Australia
2016
viii
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
Part I
Introduction
1
Chapter 1
Welcome
Welcome to Deep Learning With Python. This book is your guide to deep learning in Python.
You will discover the Keras Python library for deep learning and how to use it to develop and
evaluate deep learning models. In this book you will discover the techniques, recipes and skills
in deep learning that you can then bring to your own machine learning projects.
Deep learning does have a lot of fascinating math under the covers, but you do not need
to know it to be able to pick it up as a tool and wield it on important projects and deliver
real value. From the applied perspective, deep learning is quite a shallow field and a motivated
developer can quickly pick it up and start making very real and impactful contributions. This is
my goal for you and this book is your ticket to that outcome.
You can see that the “common sense” advice means that it is not until after you have
completed years of study and experience that you are ready to actually start developing and
evaluating machine learning model for your machine learning projects.
I think this advice is dead wrong.
2
1.2. Deep Learning With Python 3
Lessons where you learn about specific features of neural network models and or how to
use specific aspects of the Keras API.
Projects where you will pull together multiple lessons into an end-to-end project and
deliver a result, providing a template your your own projects.
Recipes where you can copy and paste the standalone code into your own project,
including all of the code presented in this book.
Background.
Multilayer Perceptrons.
At the end of this part you will know how to confidently wield Keras on your own machine
learning projects with a focus of the finer points of investigating model performance, persisting
models for later use and gaining lifts in performance over baseline models.
The best way to learn about this impressive type of neural network model is to apply it.
You will work through three larger projects and apply CNN to image data for object recognition
and text data for sentiment classification.
After completing the lessons and projects in this part you will have the skills and the
confidence of complete and working templates and recipes to tackle your own deep learning
projects using convolutional neural networks.
1.4. Requirements For This Book 6
The best way to learn about this complex type of neural network model is to apply it.
You will work through two larger projects and apply RNN to sequence classification and text
generation.
After completing the lessons and projects in this part you will have the skills and the
confidence of complete and working templates and recipes to tackle your own deep learning
projects using recurrent neural networks.
1.3.7 Conclusions
The book concludes with some resources that you can use to learn more information about a
specific topic or find help if you need it as you start to develop and evaluate your own deep
learning models.
1.3.8 Recipes
Building up a catalog of code recipes is an important part of your deep learning journey. Each
time you learn about a new technique or new problem type, you should write up a short code
recipe that demonstrates it. This will give you a starting point to use on your next deep learning
or machine learning project.
As part of this book you will receive a catalog of deep learning recipes. This includes recipes
for all of the lessons presented in this book, as well as the complete code for all of the projects.
You are strongly encouraged to add to and build upon this catalog of recipes as you expand
your use and knowledge of deep learning in Python.
Python version 2 or 3 installed. This book was developed using Python version 2.7.11.
SciPy and NumPy installed. This book was developed with SciPy version 0.17.0 and
NumPy version 1.11.0.
Matplotlib installed. This book was developed with Matplotlib version 1.5.1.
Pandas installed. This book was developed with Pandas version 0.18.0.
You do not need to match the version exactly, but if you are having problems running a
specific code example, please ensure that you update to the same or higher version as the library
specified. You will be guided as to how to install the deep learning libraries Theano, TensorFlow
and Keras in Part II of the book.
How to use more advanced techniques required for developing state-of-the-art deep learning
models.
How to use advanced image augmentation techniques in order to lift model performance.
From here you can start to dive into the specifics of the functions, techniques and algorithms
used with the goal of learning how to use them better in order to deliver more accurate predictive
models, more reliably in less time. There are a few ways you can read this book. You can dip
into the lessons and projects as your need or interests motivate you. Alternatively, you can
work through the book end-to-end and take advantage of how the lessons and projects build in
complexity and range. I recommend the latter approach.
To get the very most from this book, I recommend taking each lesson and project and build
upon them. Attempt to improve the results, apply the method to a similar but di↵erent problem,
and so on. Write up what you tried or learned and share it on your blog, social media or send
me an email at [email protected]. This book is really what you make of it
and by putting in a little extra, you can quickly become a true force in applied deep learning.
This is not a deep learning textbook. We will not be getting into the basic theory
of artificial neural networks or deep learning algorithms. You are also expected to have
some familiarity with machine learning basics, or be able to pick them up yourself.
This is not an algorithm book. We will not be working through the details of how
specific deep learning algorithms work. You are expected to have some basic knowledge of
deep learning algorithms or how to pick up this knowledge yourself.
This is not a Python programming book. We will not be spending a lot of time on
Python syntax and programming (e.g. basic programming tasks in Python). You are
expected to already be familiar with Python or a developer who can pick up a new C-like
language relatively quickly.
You can still get a lot out of this book if you are weak in one or two of these areas, but you
may struggle picking up the language or require some more explanation of the techniques. If
this is the case, see the Getting More Help chapter at the end of the book and seek out a good
companion reference text.
1.7. Summary 9
1.7 Summary
It is a special time right now. The tools for applied deep learning have never been so good.
The pace of change with neural networks and deep learning feels like it has never been so fast,
spurred by the amazing results that the methods are showing in such a broad range of fields.
This is the start of your journey into deep learning and I am excited for you. Take your time,
have fun and I’m so excited to see where you can take this amazing new technology.
1.7.1 Next
Let’s dive in. Next up is Part II where you will take a whirlwind tour of the foundation libraries
for deep learning in Python, namely the numerical libraries Theano and TensorFlow and the
library you will be using throughout this book called Keras.
Part II
Background
10
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
Chapter 2
Introduction to Theano
Theano is a Python library for fast numerical computation that can be run on the CPU or GPU.
It is a key foundational library for deep learning in Python that you can use directly to create
deep learning models. After completing this lesson, you will know:
How a very simple symbolic expression can be defined, compiled and calculated.
11
2.2. How to Install Theano 12
Theano v0.8.2is the latest at the time of writing and is used in this book.
2.6 Summary
In this lesson you discovered the Theano Python library for efficient numerical computation.
You learned:
Theano is a foundation library used for deep learning research and development.
The development and evaluation of deep learning models is easier with wrapper libraries
like Keras.
2.6.1 Next
You now know about the Theano library for numerical computation in Python. In the next
lesson you will discover the TensorFlow library released by Google that attempts to o↵er the
same capabilities.
Chapter 3
Introduction to TensorFlow
TensorFlow is a Python library for fast numerical computing created and released by Google.
It is a foundation library that can be used to create deep learning models directly or by using
wrapper libraries that simplify the process built on top of TensorFlow. After completing this
lesson you will know:
15
Random documents with unrelated
content Scribd suggests to you:
The Project Gutenberg eBook of Plain
Parochial Sermons, preached in the Parish
Church of Bolton-le-Moors
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
PLAIN
PAROCHIAL SERMONS,
PREACHED IN
London:
C. J. G. AND F. RIVINGTON, ST. PAUL’S CHURCH YARD.
1831.
BOLTON:
PRINTED BY J. GARDNER.
TO THE CONGREGATION
OF THE PARISH CHURCH OF BOLTON,
THESE SERMONS
ARE INSCRIBED AND DEDICATED,
WITH AFFECTIONATE REGARD,
BY THEIR PASTOR AND FRIEND,
J. S.
ADVERTISEMENT.
SERMON I.
AWAKE THOU THAT SLEEPEST AND ARISE FROM THE DEAD.
Genesis vi. 7.—It repented the Lord, that He had made man 38
upon the earth and it grieved Him at His heart; and the Lord
said, I will destroy man, whom I have created, from the face
of the earth.
[Preached February 6th, 1825, Sexag.]
SERMON IV.
THE PRESERVATION FROM THE FLOOD.
Luke xxiv. 32.—And they said one to another, Did not our heart 95
burn within us, while He talked with us by the way, and while
He opened to us the Scriptures?
[Preached April 13th, 1828, 1st Easter, and at Chester
Cathedral July 12th, 1829.]
SERMON VII.
IF THEY HEAR NOT MOSES AND THE PROPHETS.
Luke xvi. 31.—If they hear not Moses and the Prophets, neither 114
will they be persuaded, though one rose from the dead.
[Preached June 1st, 1823, 1st Trin.]
SERMON VIII.
PERFECT LOVE CASTETH OUT FEAR.
1 John iv. 18,—There is no fear in love, but perfect love casteth 134
out fear: because fear hath torment; he that feareth is not
made perfect in love.
[Preached June 16th, 1822, 2nd Trin.]
SERMON IX.
HUMBLE YOURSELVES UNDER THE MIGHTY HAND OF GOD.
Ezekiel xviii. 25.—Ye say, the way of the Lord is not equal. 189
Hear now, O house of Israel; is not My ways equal? are not
your ways unequal?
[Preached October 10th, 1824, 17th Trin.]
SERMON XII.
THE NEW MAN.
Ephesians iv. 24.—That ye put on the new man, which after God 209
is created in righteousness and true holiness.
[Preached October 13th, 1822, 19th Trin.]
SERMON XIII.
THE WEDDING GARMENT.
1 Samuel iii. 1.—The word of the Lord was precious in those 271
days; there was no open vision.
[Preached December 9th, 1827. 2nd Advent]
SERMON XVI.
DISTINCTIONS TO BE MADE ON THE DAY OF JUDGMENT.
Matthew xxiv. 40.—The one shall be taken and the other left. 290
[Preached December 12th, 1824, 3rd Advent.]
SERMON XVII.
GOD MADE MAN UPRIGHT; MAN MAKES HIMSELF MISERABLE.
Eccles. vii. 29.—Lo, this only have I found, that God hath made 310
man upright, but they have sought out many inventions.
[Preached August, 1828, and at Chester Cathedral, June 28th,
1829.]
SERMON XVIII.
THE KNOWLEDGE OF GOD REVEALED TO THEM THAT FEAR HIM.
Psalm xxv. 14.—The secret of the Lord is with them that fear 329
Him; and He will shew them His covenant.
[Preached November 19th, 1826, and at Chester Cathedral,
July 29th, 1827.]
SERMON XIX.
RESIST THE BEGINNINGS OF EVIL TEMPTATION.
Proverbs iv. 14, 15.—Enter not into the path of the wicked, and 349
go not in the way of evil men. Avoid it, pass not by it, turn
from it, and pass away.
[Preached October 10th, 1830.]
SERMON XX.
THE LOVE OF CHRIST FOR THOSE WHO DO THE WILL OF GOD.
Mark iii. 35.—Whosoever shall do the will of God, the same is 366
My brother and My sister and mother.
[Preached February 3rd, 1828.]
SERMON XXI.
ON SEEKING OUT THE WORKS OF THE LORD AND PRAISING HIM.
Psalm cxi. 1, 2.—I will give thanks unto the Lord with my whole 385
heart; in the assembly of the upright and in the congregation.
The works of the Lord are great, sought out of all them that
have pleasure therein.
[Preached November 23rd, 1828.]
SERMON XXII.
DILIGENCE AND PERSEVERANCE IN THE CHRISTIAN RACE.
Ephesians v. 14.
Wherefore, he saith, Awake, thou that sleepest, and arise from
the dead, and Christ shall give thee light.
In this chapter the Apostle has been reminding his Ephesian converts
of the state in which they were, before they had received and
obeyed the call of the gospel. The people of Ephesus were highly
endowed, in the world’s estimation, not only with riches, but also
with talent and learning, and refinement; with all the arts and
ornaments of civilized life. And yet, how does St. Paul describe them
in the 8th verse? “Ye were sometimes darkness;” how in the 12th?
“For it is a shame even to speak of those things which are done of
them in secret.”
Here, you observe, we have a remarkable declaration from the
mouth of an Apostle, that a people, however talented and learned,
were still wrapt in the mantle of darkness, with regard to their real
good and happiness; with regard to their religious and moral
condition. Whatever nature had done for them, to whatever
eminence they had been raised by art or industry, they were left far
short of the object which it concerned them most to attain—an
acquaintance with God, a knowledge and practice of His law; a
peace with Him and with their own consciences. So far were they
from this, that their characters were stained with the most debasing
vices; their secret sins were too abominable even to be mentioned.
Thus we see how little the instructions and advantages of this world
have to do with reforming the conduct, or amending the depraved
heart of man. And what was true in this instance, is true in all;
there is no teaching, there are no rules of prudence, no maxims
however wise, no manners however polished, that can cleanse the
heart of its natural unrighteousness, and curb its natural propensity
to evil: give what you may, educate as you may, man, if left to his
own wisdom and strength, will remain what he is by fallen nature, a
weak, a wayward, and a wicked being; an enemy to holiness and to
God. There may be a shew of wisdom “falsely so called;” there may
be a refined conversation and a polished outside; but there will
always be uncleanness remaining within. The evil principles may
wear a dazzling veil, and the vices may be clothed in fashionable
garments, but they will be evil principles and vices still.
There is but one means by which the darkness of nature can be
scattered, and that is by the light of God’s truth; but one means by
which the evil spirit of the natural man can be cast out, and that is
by the Spirit of God. The blessed Jesus came into the world to
reclaim and redeem it from the grossness in which it was sunk; to
open a new scene of things; to impart a new life; to banish the thick
cloud of error and of sin, in which the world hopelessly and
irrecoverably lay; and to raise it to the knowledge and service, the
favour and blessing of an offended God. This is the description of
the happy effects which the gospel is intended and fitted to produce;
“the people that walked in darkness have seen a great light; they
that dwell in the land of the shadow of death, upon them hath the
light shined.” [4] All, without the gospel, are in this miserable
condition, whatever they may think of themselves: all who sincerely
embrace it, are enlightened and happy, however poor and humble,
and of whatever else they may be ignorant.
Poor and humble did I say? It is to them, that this light is the most
easily, and frequently, and effectually communicated. The
prosperous and the great too often resemble the wealthy Ephesians,
“having the understanding darkened, being alienated from the life of
God through the ignorance that is in them, because of the blindness
of their heart;” [5] revelling in the self-sufficiency of their earthly
comforts, proud of their acquirements, fond of their own way, they
disdain to be taught the humbling truths of the gospel from a fellow-
creature like themselves: and often has the minister of the gospel to
be thankful to his Lord and Master, that, when he finds his message
rejected and despised by his wealthier hearers, it still makes its way
into the hearts of some of the poor: grieved he is indeed, that those,
who ought to know it best and love it most, should be so deluded by
worldly vanities and follies, as to continue, amidst all their
advantages of education, in spiritual darkness and death; set against
the messenger, because hating the truth of his message: yet, is it a
comfort to him, sincere and unspeakable, that he meets with more
success among the ignorant, as they are called, and the children of
the poor: that there he finds wisdom, “the wisdom which is from
above;” and there he finds friends among the friends of God.
It was so in the Apostle’s day; and with some bright exceptions, it
has been the same in every day: “For ye see your calling, brethren,
how that not many wise men after the flesh, not many mighty, not
many noble are called; but God hath chosen the foolish things of the
world to confound the wise; and God hath chosen the weak things
of the world, to confound the things that are mighty: and base
things of the world, and things which are despised hath God chosen;
yea, and things which are not, to bring to nought things that are:
that no flesh should glory in his presence.” [7]
All these observations have been made, to connect and explain the
first word of the text, wherefore; “wherefore, he saith, awake thou
that sleepest and arise from the dead, and Christ shall give thee
light.” Inasmuch as it is impossible for thee to know and to please
God, to attain unto holiness and happiness, to save thy soul, by the
light of nature, (for nature is in fact, of itself and for such a purpose,
no light at all,) turn to the way, which is opened to thee by the
shining of the Sun of Righteousness; to that one way, which is
opened alike for all mankind, rich and poor, learned and unlearned;
turn to thy Redeemer, in humble faith and hearty desire, and “He
shall give thee light:” learn of Him and He shall teach thee all that
thou needest to know: seek of Him, and He shall guide thee into all
righteousness and truth; lean on Him, and He shall support thee,
through all the course of thy earthly pilgrimage; and conduct thee in
peace and safety to thy journey’s end.
“Wherefore, he saith;” there is no particular passage in the Old
Testament, in which these words of the text are found; but they
seem to allude to several expressions of similar import, in the
prophecy of Isaiah. In the 26th chapter, there is a passage which
describes the deliverance of God’s people from a state of
degradation, both political and spiritual, under the figure of a
resurrection from the dead: “Thy dead men shall live, together with
my dead body shall they arise. Awake and sing, ye that dwell in
dust; for thy dew is as the dew of herbs, and the earth shall cast out
the dead.” [8] And again, in the 52nd chapter: “Awake, awake, put
on thy strength, O Zion; put on thy beautiful garments, O Jerusalem,
the Holy city; for henceforth there shall no more come in to thee the
uncircumcised and the unclean; shake thyself from the dust; arise
and sit down, O Jerusalem: loose thyself from the bands of thy neck,
O captive daughter of Zion: for thus saith the Lord, ye have sold
yourselves for nought; and ye shall be redeemed without money:”
[9a]
a powerful call upon the Jewish people to cast away their
transgressions, through which they had been brought into a state of
grievous captivity, and to throw themselves on the Lord’s mercy, and
return to the Lord’s service, that He might break their bonds
asunder, and visit them with His salvation. One more passage there
is, to which the Apostle clearly alludes, in the opening of the 60th
chapter: “Arise, shine, for thy light is come, and the glory of the Lord
is risen upon thee. For behold, the darkness shall cover the earth,
and gross darkness the people: but the Lord shall arise upon thee,
and his glory shall be seen upon thee.” [9b] Here the prophet foretels
the glorious dawn of gospel light, and calls upon the Church to arise
and behold it, shining from afar; to behold it with the eye of faith; to
look forward to that Saviour, that great “fountain for sin and
uncleanness,” which the law and the prophets did all with one voice
proclaim. The prophet adds, “And the gentiles shall come to thy
light, and kings to the brightness of thy rising.” The first coming of
the gentile world was visible in the footsteps of the wise men, who
came “from the east to Jerusalem,” [10] to worship the infant Jesus:
and ever since our Lord’s return to the heavens, the gospel has been
preached to all nations; and accepted, more or less, by the kings
and potentates of the earth.
And, as the prophet called on the people of old, to awake and arise
and turn to the coming light, so St. Paul invited and animated his
converts and their brethren, to awake and behold the glory of the
Lord, after it had been fully revealed to the dark and sinful world;
and so do the ministers of Christ, in every age, call upon their
hearers to arouse from their benighted and lost condition, and let
this light shine upon their understandings and hearts, and direct
them in the way of life and salvation. For grieved are we to say, that
notwithstanding these bright beams of grace and truth have been so
long pouring forth their splendour upon the earth, yet are there
many dark corners; and many eyes awfully closed against the light:
and still more grieved are we to say, that even in the land where
these beams have shone brightest, even in this land, vast numbers
yet remain total strangers to their enlightening influence and
converting power: numbers who have had the benefit of being
educated under the gospel, who have witnessed its happy effects;
who have seen what it has done for their relations, or friends, or
neighbours, have yet ungratefully and disdainfully turned away from
the heavenly light, and “walked on still in darkness;” have sided with
the world and Satan and sin, and resisted the salvation of their
souls.
O, that they could be brought, O for the grace of God’s Holy Spirit to
bring them, to listen to the warning words of that merciful Saviour,
to whom, if they now continue to despise Him, they will one day lift
up their hands in vain: these are His words, “if the light that is in
thee be darkness, how great is that darkness.” [12] If, after all the
gracious offers of pardon and life, which thy Redeemer has made
thee, by His own mouth, and the mouth of His messengers, thou still
choosest unforgiveness and death, going on in the heedlessness of
thy impenitent heart, and wantoning in sin, how dreadful is thy
condition! how infinitely more dreadful, than if the voice of mercy
had never sounded in thine ears. Be convinced: let the love of thy
Saviour work upon thee; let the love of thine own immortal soul
move thee to fly unto Him, the great, the only, the everlasting
Redeemer. Leave thy way of misery and ruin, and turn to Him for
comfort and deliverance. Turn, while thou hast the power; the night
is fast coming. Thou knowest not how many more sabbaths, how
many more invitations and warnings, will be vouchsafed: many thou
hast had already; enough of them thou hast already slighted. Come,
ye that are strong, for the strong are often laid low; come, ye that
are young, for the young are not always spared; come, ye aged, for
your hour of trial must be nearly run out. Come all, while ye may, to
the Lamb of God, for acceptance and for blessing: there is no safety,
and no hope in any other: and no hope in Him, when the door is
once shut; “we pray you, in Christ’s stead, be ye reconciled to God.”
[13]
The text says, “Awake thou that sleepest;” it means, awake from the
sleep of sin; and very fitly is the state of the sinner compared to a
state of sleep: he is quite insensible of his true, his awful condition;
he fears not, perceives not, the doom that is awaiting him. Satan
has bound up his senses; the eyes of his understanding are closed,
and his knowledge of good and evil is utterly prevented. He is to
the spiritual world, what the sleeping man is to the natural,
unconscious of what is going forward to his advantage or his injury.
Speak to him of mercy, he hears not: “sing him one of the songs of
Sion,” it is all in vain: speak to him of divine wrath, of eternal
punishment; to what purpose, while his ear is closed? The whispers
of conscience, the counsel of friends, “the tongues of men or of
angels,” are alike unprofitable, while a deep sleep is cast upon the
soul.
And there is a further resemblance: the sinner dreams, of happiness
arising from worldly prosperity, from plenty and pleasure: and as the
brain of a poor or disconsolate man, in a state of sleep, is often filled
with ideas of such things, and he awakes and finds them sadly
untrue; awakes from his pleasant dreaming to his state of drudgery
and discomfort; so is the sinner often constrained to feel and
confess, that his notions of happiness were no better than a dream;
that they were unsubstantial and unreal, promising much and
bringing little: still he is unconvinced; pursues his course of trifling,
his disappointed dreamings, till at length he awakes in another
world, and thoroughly perceives the wretchedness of his condition,
which it is then too late, impossible to change. From this dreadful,
fatal sleep of sin, the gospel is designed to rouse us: and I pray God,
that our conscience may be effectually alarmed and awakened; that
we may be alive and active in perceiving and following “the things
that belong unto our peace!”
The text says further, “Arise from the dead;” from the death of sin;
from the state of misery and ruin, in which ye insensibly lie. Here is
another significant figure: the impenitent sinner is not only plunged
into a condition of helpless wretchedness, but he has no energy to
recover from it, no quickening or effectual desire of better things; no
more perception of spiritual interests, of heavenly objects, than a
corpse has of the natural world. When once the breath has left the
body, the busiest scenes of earth can affect it no longer; nothing can
“charm the dull cold ear of death:” when the breath of a divine life is
not in the soul, when the new-creating spirit of God is not received
and cherished, the beauty of holiness and the all-important interests
of a spiritual and eternal world produce no effect upon the forlorn
understanding and the deserted heart: no representations of
spiritual truth can move the heavy ear of a besotted and determined
sinner; none, while he is resolved, so to remain: not even the voice
of the Son of God, “charm He never so wisely.” Till the heart be
moved to repentance, till, the faculties of the soul are recovered
from the fascination of stupor and sin, no living impression can be
made, even with all the force that truth can carry. How often do we
find this to be the case! how often does the sinner acknowledge the
justice, the certainty, the necessity of what is urged upon him, but
without any alteration in his character; without any effectual or
lasting alteration. His heart is unchanged: the slave of sin; dead in
sin; not alive or open to the force of truth, to the doctrines of
righteousness or salvation.
Infatuated sinner! thine own conscience accuses thee; thou believest
that there will be a world to come, a world of recompence, and yet
thou turnest not to prepare for it; pray, when thou fearest; pray,
when thou thinkest of these things; cry earnestly to thy Saviour, that
he may deliver thee from this “gall of bitterness and this bond of
iniquity;” pray for the convincing, converting, life-giving Spirit, that
He may “set thine heart at liberty” from the thraldom of sin; and
thus enable thee to listen to the call of the gospel, and turn thy feet
in earnest to the Redeemer of thy soul. For if thou listenest and
turnest not, “dead thou art while thou livest;” and when thou diest,
eternally dead; dead to all comfort and happiness for ever; dead in a
world of woe.
But if we will (and God grant that we all may) awake and arise,
“Christ will assuredly give us light:” “He is the true light, which
lighteth every man that cometh into the world;” [18] ready to shine
upon every soul, to lighten it in darkness and quicken it in death.
Believe in Him, and live in Him, and the clouds of ignorance shall be
scattered away; and the drowsiness of the soul shall be cast off; and
the cold heart of the natural man shall be warm with life again. In
the midst of this world’s temptations and trials, troubles and
perplexities, we shall see our way clear, our way to the heavenly
Jerusalem; a brightness, the brightness of God’s presence, will be
resting upon our souls; the world sees it not, but we shall see and
enjoy it every hour: dark things will be made light, and “crooked
things will be made straight, and the rough places plain:” we shall
be living above the world, for “our life will be hid with Christ in God:”
[19]
cheerful we shall be when nature is sad: inspirited when nature is
languishing; full of praises and thanksgivings when nature is
mourning.
Say, Christian people, have ye never seen the triumph of faith over
nature’s weakness and Satan’s power? have ye never, in the hour of
trial, witnessed that the Saviour was near? never observed the
fainting spirit animated and sustained? never beheld the closing eye,
of the dying saint, beaming with heavenly fire; and the pale features
lighted up with the smile of satisfaction and composure and peace?
If ye have not, the dying Christian will shew you these things—go to
his bed, and learn the lesson; go, and catch the hope, that “Christ
will give you light.”
SERMON II.
THE UNSEARCHABLE RICHES OF CHRIST.
Eph. iii 8.
The unsearchable riches of Christ.