Book Image

Deep Learning with fastai Cookbook

By : Mark Ryan
Book Image

Deep Learning with fastai Cookbook

By: Mark Ryan

Overview of this book

fastai is an easy-to-use deep learning framework built on top of PyTorch that lets you rapidly create complete deep learning solutions with as few as 10 lines of code. Both predominant low-level deep learning frameworks, TensorFlow and PyTorch, require a lot of code, even for straightforward applications. In contrast, fastai handles the messy details for you and lets you focus on applying deep learning to actually solve problems. The book begins by summarizing the value of fastai and showing you how to create a simple 'hello world' deep learning application with fastai. You'll then learn how to use fastai for all four application areas that the framework explicitly supports: tabular data, text data (NLP), recommender systems, and vision data. As you advance, you'll work through a series of practical examples that illustrate how to create real-world applications of each type. Next, you'll learn how to deploy fastai models, including creating a simple web application that predicts what object is depicted in an image. The book wraps up with an overview of the advanced features of fastai. By the end of this fastai book, you'll be able to create your own deep learning applications using fastai. You'll also have learned how to use fastai to prepare raw datasets, explore datasets, train deep learning models, and deploy trained models.
Table of Contents (10 chapters)

What this book covers

Chapter 1, Getting Started with fastai, shows you how to set up an environment for fastai, takes you through training an initial hello world fastai model, explains the four key application areas of fastai (tabular data, text data, recommender systems, and image data), and compares fastai with the other important high-level deep learning framework, Keras.

Chapter 2, Exploring and Cleaning Up Data with fastai, describes the set of datasets that fastai makes available out of the box (the curated datasets); describes how to examine tabular, text, and image datasets; and shows how to use the facilities of fastai to clean up a dataset, for example, by dealing with missing values.

Chapter 3, Training Models with Tabular Data, explains how to create fastai deep learning models trained on tabular datasets, that is, datasets that are arranged in rows and columns. Examples in this chapter show you how to train fastai models on both curated and standalone datasets.

Chapter 4, Training Models with Text Data, explains how to create fastai deep learning models trained on text datasets. Examples in this chapter show you how to train language models (that is, models that predict the next word given a series of words), as well as how to train text classification models (that is, models that predict, for example, whether a given review is negative or positive). This chapter covers models trained with both curated and standalone datasets.

Chapter 5, Training Recommender Systems, explains how to use fastai to create recommender systems, that is models that predict, for example, whether a particular reader will like a particular book given a set of ratings that other readers have provided for this book. This chapter covers recommender systems trained with both curated and standalone datasets.

Chapter 6, Training Models with Visual Data, explains how to use fastai to create deep learning models trained on image datasets. Examples in this chapter show you how to create image classification systems for images that depict one or more objects, trained on both curated and standalone datasets.

Chapter 7, Deployment and Model Maintenance, explains how you can take a trained fastai model and deploy it in a simple web application. The examples in this chapter show you how to deploy fastai deep learning models trained on tabular and image datasets. This chapter also tells you how to maintain models once they have been deployed.

Chapter 8, Extended fastai and Deployment Features, explains additional aspects of fastai, including enhancements to the models introduced from Chapter 3, Training Models with Tabular Data, to Chapter 6, Training Models with Visual Data, as well as variations on the deployment techniques introduced in Chapter 7, Deployment and Model Maintenance.