16.03.2021 Views

Advanced Deep Learning with Keras

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Deep Neural Networks

While this chapter's focus is on deep neural networks; we'll begin this chapter by

discussing an important feature of Keras called the Functional API. This API acts

as an alternative method for building networks in Keras and enables us to build

more complex networks that cannot be accomplished by the sequential model. The

reason why we're focusing so much on this API is that it will become a very useful

tool for building deep networks such as the two we're focusing on in this chapter.

It's recommended that you've completed, Chapter 1, Introducing Advanced Deep

Learning with Keras, before moving onto this chapter as we'll refer to introductory

level code and concepts explored in that chapter as we take them to an advanced

level in this chapter.

The goals of this chapter is to introduce:

• The Functional API in Keras, as well as exploring examples of networks

running it

• Deep Residual Networks (ResNet versions 1 and 2) implementation in Keras

• The implementation of Densely Connected Convolutional Networks

(DenseNet) into Keras

• Explore two popular deep learning models, ResNet, and DenseNet

Functional API

In the sequential model that we first introduced in Chapter 1, Introducing Advanced

Deep Learning with Keras, a layer is stacked on top of another layer. Generally, the

model will be accessed through its input and output layers. We also learned that

there is no simple mechanism if we find ourselves wanting to add an auxiliary

input at the middle of the network, or even to extract an auxiliary output before

the last layer.

That model also had its downside, for example, it doesn't support graph-like models

or models that behave like Python functions. In addition, it's also difficult to share

layers between the two models. Such limitations are addressed by the functional

API and are the reason why it's a vital tool for anyone wanting to work with deep

learning models.

[ 40 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!