Skip to main content

Resource Guide: Deep Learning Frameworks

Last Updated: January 2024

This guide assumes you already have some familiarity with machine learning in general, and now you want to work on a deep learning (neural network) project but don’t know where to start.

While you can create deep learning models in multiple languages, Python is the most common and our recommendation. Within Python, there are two main frameworks: PyTorch and TensorFlow. As of early 2024, PyTorch is used more in academic settings, and TensorFlow more in industry settings. Matlab, which is widely used in academia, also has a deep learning toolbox.

Not sure which framework to pick? We recommend you start with PyTorch, mostly because it is commonly used within academia and is object oriented. BUT, we also recommend that you start working with PyTorch through Keras, a high-level interface, rather than working with PyTorch directly. Keras provides a common interface to work with either PyTorch or TensorFlow, and you can use it without detailed knowledge of either. Keras simplifies common workflows and will make it easier for you to get started and share your code with others. As you gain more experience with deep learning models and need to control more details about them, you can then start interacting directly with PyTorch or TensorFlow.

Getting Started

Google Colaboratory Google Colaboratory (or “Colab” for short) is a great space to try learn deep learning frameworks without worrying about installation or dependency issues on your own machine. Colab allows you to write and execute Python code in your web browser, free of charge. You can start your deep learning projects here and slowly transition to your own computer as you get more familiar with either PyTorch or TensorFlow. Note that some of the guides below will link you directly to Colab notebooks so you can work through their examples on the web.

PyTorch

  • Learn the basics. This tutorial that is part of the PyTorch official documentation introduces you to PyTorch and teaches you how to build a neural network with it. Ideal for beginners.
  • Tutorials. The PyTorch documentation also has a variety of tutorials on more advanced topics. The PyTorch recipes are particularly useful to help you speed up your coding without reinventing the wheel.
  • PyTorch Example Implementations. This GitHub repository contains minimal model implementations, ranging from simple examples like linear regression to more complicated generative AI models.
  • freeCodeCamp Machine Learning with PyTorch course. freeCodeCamp provides 24 hours worth of videos that lead you through the the concepts underlying deep learning models (such as tensors), the PyTorch workflow, and then applications to classification and computer vision.
  • Generative Adversarial Networks: Build Your First Models. This RealPython tutorial by Renato Candido is a good example of how to use PyTorch for a specific task. Short and self-contained, it will give you PyTorch experience.

TensorFlow

Keras

  • Introduction to Keras. The official Keras tutorials are quite comprehensive, hence we recommend you spend some time here.
  • Keras Code Examples. The Keras documentation also has many examples for implementing a variety of learning tasks. You will likely find some of those useful for your own project.

Matlab

  • Deep Learning Onramp from Mathworks. If you are a Matlab user and you plan on using it for your deep learning projects, then this tutorial is for you. It takes only about 2 hours and will provide you with the necessary tools to use the Matlab Deep Learning Toolbox.

Getting Better

Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow by Aurélien Géron. One of a few books updated to reflect the simpler TensorFlow 2.0 syntax, Hands-On Machine Learning moves slowly relative to a tutorial, video, or blog post; however, it offers much more detail on how networks are constructed and manipulated in TensorFlow, with chapters on custom layers, computer vision, sequential data, and reinforcement learning. If you’re new to TensorFlow or neural nets, start with Chapter 10 for an introduction and work along with the text in a notebook on Colab.

Machine Learning with PyTorch and Scikit-Learn by Raschka, Liu and Mirjalili. A gentle but comprehensive introduction to machine learning. The first half restricts itself to Scikit-Learn, while the second half, which involves deep learning and a chapter on transformers (the architecture behind the GPT family of language models) uses PyTorch. A great resource to understand a bit more of the “under the hood” mechanisms in your ML models. Feel free to skip to the PyTorch sections if you are already at an intermediate level. Note that the current version uses PyTorch 1.9, but you shouldn’t have much problem if you’ve gone through the “Getting Started” materials above.