Book Image

Deep Learning from the Basics

By : Koki Saitoh
5 (1)
Book Image

Deep Learning from the Basics

5 (1)
By: Koki Saitoh

Overview of this book

Deep learning is rapidly becoming the most preferred way of solving data problems. This is thanks, in part, to its huge variety of mathematical algorithms and their ability to find patterns that are otherwise invisible to us. Deep Learning from the Basics begins with a fast-paced introduction to deep learning with Python, its definition, characteristics, and applications. You’ll learn how to use the Python interpreter and the script files in your applications, and utilize NumPy and Matplotlib in your deep learning models. As you progress through the book, you’ll discover backpropagation—an efficient way to calculate the gradients of weight parameters—and study multilayer perceptrons and their limitations, before, finally, implementing a three-layer neural network and calculating multidimensional arrays. By the end of the book, you’ll have the knowledge to apply the relevant technologies in deep learning.
Table of Contents (11 chapters)

Implementing a Simple Layer

In this section, we will implement the apple example we've described in Python using the multiplication node in a computational graph as the multiplication layer (MulLayer) and the addition node as the addition layer (AddLayer).

Note

In the next section, we will implement the "layers" that constitute a neural network in one class. The "layer" here is a functional unit in a neural network—the Sigmoid layer for a sigmoid function, and the Affine layer for matrix multiplication. Therefore, we will also implement multiplication and addition nodes here on a "layer" basis.

Implementing a Multiplication Layer

We will implement a layer so that it has two common methods (interfaces): forward() and backward(), which correspond to forward propagation and backward propagation, respectively. Now, you can implement a multiplication layer as a class called MulLayer, as follows (the source code is located at ch05/layer_naive...