# fastai: A Layered API for Deep Learning

**Authors:** Jeremy Howard, Sylvain Gugger  
**arXiv:** [2002.04688](https://arxiv.org/abs/2002.04688)  
**Date:** 2020-02-11  
**Summary page:** https://www.summarizepaper.com/en/paper/2002.04688v2/

## Key points

- Fastai is a deep learning library that offers high-level components for practitioners to quickly achieve state-of-the-art results in standard deep learning domains, as well as low-level components for researchers to build new approaches.
- The library achieves this without compromising ease of use, flexibility, or performance through its carefully layered architecture that expresses common underlying patterns of many deep learning and data processing techniques in terms of decoupled abstractions.
- Fastai includes several features such as a new type dispatch system for Python with a semantic type hierarchy for tensors, a GPU-optimized computer vision library that can be extended in pure Python, an optimizer that refactors out the common functionality of modern optimizers into two basic pieces allowing optimization algorithms to be implemented in 4-5 lines of code, a novel 2-way callback system that can access any part of the data, model or optimizer and change it at any point during training, and a new data block API.
- The library has been used successfully to create a complete deep learning course which was written more quickly than using previous approaches while producing clearer code.
- Fastai's approach focuses on providing both high-level and low-level components to cater to both practitioners and researchers alike. Its layered architecture allows users to easily mix-and-match components while still achieving state-of-the-art results.
- Fastai provides users with tools such as visualizations and explanations to help them better understand their models' behavior.

## Summary

Fastai is a deep learning library that offers high-level components for practitioners to quickly achieve state-of-the-art results in standard deep learning domains, as well as low-level components for researchers to build new approaches. The library achieves this without compromising ease of use, flexibility, or performance through its carefully layered architecture that expresses common underlying patterns of many deep learning and data processing techniques in terms of decoupled abstractions. These abstractions can be expressed concisely and clearly by leveraging the dynamism of the underlying Python language and the flexibility of the PyTorch library. Fastai includes several features such as a new type dispatch system for Python with a semantic type hierarchy for tensors, a GPU-optimized computer vision library that can be extended in pure Python, an optimizer that refactors out the common functionality of modern optimizers into two basic pieces allowing optimization algorithms to be implemented in 4-5 lines of code, a novel 2-way callback system that can access any part of the data, model or optimizer and change it at any point during training, and a new data block API. The library has been used successfully to create a complete deep learning course which was written more quickly than using previous approaches while producing clearer code. Fastai is already widely used in research, industry and teaching. The design choices made by libraries like Scikit-learn, Torchvision and pandas demonstrate how different sets of design choices can result in very different user experiences. Fastai's approach focuses on providing both high-level and low-level components to cater to both practitioners and researchers alike. Its layered architecture allows users to easily mix-and-match components while still achieving state-of-the-art results. Furthermore, fastai provides users with tools such as visualizations and explanations to help them better understand their models' behavior. This feature is especially useful when first learning ideas such as collaborative filtering where it can be difficult to interpret the results of training the model. Overall, fastai is a powerful deep learning library that offers both high-level and low-level components for practitioners and researchers alike. Its carefully layered architecture allows for ease of use, flexibility, and performance while providing users with tools to better understand their models' behavior.
