Book Image

Hands-On Neural Networks

By : Leonardo De Marchi, Laura Mitchell
Book Image

Hands-On Neural Networks

By: Leonardo De Marchi, Laura Mitchell

Overview of this book

Neural networks play a very important role in deep learning and artificial intelligence (AI), with applications in a wide variety of domains, right from medical diagnosis, to financial forecasting, and even machine diagnostics. Hands-On Neural Networks is designed to guide you through learning about neural networks in a practical way. The book will get you started by giving you a brief introduction to perceptron networks. You will then gain insights into machine learning and also understand what the future of AI could look like. Next, you will study how embeddings can be used to process textual data and the role of long short-term memory networks (LSTMs) in helping you solve common natural language processing (NLP) problems. The later chapters will demonstrate how you can implement advanced concepts including transfer learning, generative adversarial networks (GANs), autoencoders, and reinforcement learning. Finally, you can look forward to further content on the latest advancements in the field of neural networks. By the end of this book, you will have the skills you need to build, train, and optimize your own neural network model that can be used to provide predictable solutions.
Table of Contents (16 chapters)
Free Chapter
1
Section 1: Getting Started
4
Section 2: Deep Learning Applications
9
Section 3: Advanced Applications

An overview of machine learning

ML is a variegated field with many different types of algorithms that try to learn in slightly different ways. We can divide them into the following different categories according to the way the algorithm performs the learning:

  • Supervised learning
  • Unsupervised learning
  • Semi-supervised learning
  • Reinforcement learning

In this book, we are going to touch on each single category, but the main focus will be supervised learning. We are going to briefly introduce these categories and the type of problems that they help solve.

Supervised learning

Supervised learning is nowadays the most common form of ML applied to business processes. These algorithms try to find a good approximation of the function that is mapping inputs and outputs.

To accomplish that, it is necessary to provide both input values and output values to the algorithm yourself, as the name suggests, and it will try to find a function that minimizes the errors between the predictions and the actual output.

The learning phase is called training. After a model is trained, it can be used to predict the output from unseen data. This phase is commonly regarded as scoring or predicting, which is depicted in the following diagram:

Unsupervised learning

Unsupervised learning works with unlabeled data, so we don't need the actual output, only the input. It tries to find patterns in the data and reacts based on those commonalities, dividing the input into clusters:

Usually, unsupervised learning is often used in conjunction with supervised learning to reduce the input space and focus the signal in the data on a smaller number of variables, but it has other goals as well. From this point of view, it is more applicable than supervised learning as sometimes tagging the data is expensive or not reliable.

Common unsupervised learning techniques are clustering and principal component analysis (PCA), independent component analysis (ICA), and some neural networks such as Generative Adversarial Networks (GANs) and Autoencoders (AEs). We will explore the last two in more depth later on in this book.

Semi-supervised learning

Semi-supervised learning is a technique in between supervised and unsupervised learning. Arguably, it should not be a category of machine learning but only a generalization of supervised learning, but it's useful to introduce the concept separately.

Its aim is to reduce the cost of gathering labeled data by extending a few labels to similar unlabeled data. Some generative models are classified semi-supervised approaches.

Semi-supervised learning can be divided into transductive and inductive learning. Transductive learning is when we want to infer the labels for unlabeled data. The goal of inductive learning is to infer the correct mapping from inputs to outputs.

We can see this process as similar to most of the learning we had at school. The teacher shows the students a few examples and gives them some to take home; to solve those, they need to generalize.

Reinforcement learning

Reinforcement learning (RL) is the most distinct category, with respect to the one we saw so far. The concept is quite fascinating: the algorithm is trying to find a policy to maximize the sum of rewards.

The policy is learned by an agent who uses it to take actions in an environment. The environment then returns feedback, which the agent uses to improve its policy. The feedback is the reward for the action taken and it can be a positive, null, or negative number, as shown in the following diagram: