PyTorch
PyTorch is an open-source machine-learning framework for Python that provides tensor computation, automatic differentiation, and tools for building and training neural networks.
Inside Deep Learning: Math, Algorithms, Models
A Python deep learning library that provides tensor computation, automatic differentiation, and data abstractions for neural network training.
- How it is used
- Supports tensor computation, GPU acceleration, automatic differentiation, and parameter optimization for neural network training.
- How deep it goes
- Explains tensor shapes, device placement, gradients, learning rates, and optimizer loops, while deferring broader Dataset usage details.
- Examples
- Uses tensor construction, NumPy conversion, matrix multiplication, device errors, quadratic minimization, SGD loops, and PCA autoencoder modules.
- What you can do after
- Build and optimize tensor-based models with PyTorch automatic differentiation, CUDA placement, Parameters, losses, and SGD.
Read how Inside Deep Learning: Math, Algorithms, Models explains PyTorch →
Deep Learning with R, Third Edition
PyTorch is an open-source machine-learning library providing tensor computation and automatic differentiation capabilities.
- How it is used
- Provides tensor operations and gradients for direct neural-network training or as a Keras backend.
- How deep it goes
- Works through tensors, backward(), manual weight updates, Modules, optimizers, and custom training steps; mentions compilation without developing its internals.
- Examples
- Uses tensor creation, a squared-tensor gradient, a pure-PyTorch linear classifier, and a Keras custom training step.
- What you can do after
- Build it from scratch: train a linear classifier in PyTorch; apply it via Keras’s torch backend for a custom training step.
Read how Deep Learning with R, Third Edition explains PyTorch →
Deep Learning with PyTorch, Second Edition
The PyTorch core Python library namespace that exposes tensor operations and functions such as mathematical elementwise operations.
- How it is used
- Uses PyTorch to express tensor calculations and support building, training, and deploying deep learning models.
- How deep it goes
- Defines the library’s core components and works through first tensor operations, while deferring detailed treatment of tensors and autograd.
- Examples
- Demonstrates `torch.ones(3)` with element access and assignment, then asks readers to find and test an element-wise mathematical function.
- What you can do after
- Apply it via the `torch` module to create and modify a tensor and explore mathematical operations on it.
Read how Deep Learning with PyTorch, Second Edition explains PyTorch →
Natural Language Processing in Action, Second Edition
PyTorch is an open-source machine-learning framework for building and training neural-network models with tensor computation and automatic differentiation.
- How it is used
- Builds a name-based neural classifier and runs tensor-based convolution to inspect grammatical patterns.
- How deep it goes
- Works through model definition, loss, SGD, backpropagation, and evaluation, then demonstrates a convolution with hardcoded weights.
- Examples
- Uses character n-grams of names for binary classification and part-of-speech vectors to detect an adverb–verb–noun sequence.
- What you can do after
- Build it from scratch as a PyTorch single-neuron classifier, train it with SGD, and check held-out accuracy.
Read how Natural Language Processing in Action, Second Edition explains PyTorch →
Deep Learning with Python, Third Edition
A Python machine-learning library used here as one of the frameworks whose code can run element-wise operations on GPUs; only PyTorch is actually a library entry in the glossary, but the section groups it with JAX and TensorFlow as frameworks.
- How it is used
- Provides tensor computation and gradient-based training, either directly or as a Keras backend.
- How deep it goes
- Works through tensors, parameters, gradients, a linear classifier, Module, optimizers, and compilation, without developing compiler internals.
- Examples
- Uses tensor operations, a squared-value gradient, a pure-PyTorch linear classifier, and top-class gradients for ConvNet interpretation.
- What you can do after
- Build it from scratch as a small PyTorch linear classifier with a gradient-based training step.
Read how Deep Learning with Python, Third Edition explains PyTorch →
Learn Generative AI with PyTorch
A deep learning library used here for building and training neural networks, especially with dynamic computation graphs and GPU acceleration.
- How it is used
- Uses PyTorch to build deep neural networks for classification before applying them to generative modeling.
- How deep it goes
- Explains dynamic graphs and GPU training, then outlines a tensor-to-validation workflow without giving low-level graph internals.
- Examples
- Works through labeled grayscale clothing images, a dense network, cross-entropy loss, Adam, and a validation set.
- What you can do after
- Build it from scratch: train a PyTorch clothing-image classifier and use validation data to assess training choices.
Read how Learn Generative AI with PyTorch explains PyTorch →
Math and Architectures of Deep Learning
An open-source machine learning library used here to provide the chapter's executable code examples and automatic gradient computation.
- How it is used
- Provides executable counterparts for mathematical operations, statistical models, neural-network training, and convolution in machine-learning workflows.
- How deep it goes
- Demonstrates practical APIs and tensor shapes through worked code, while stopping short of library internals and learned-kernel theory.
- Examples
- Demonstrates matrix diagonalization, PCA and LSA, classifier training, custom convolution kernels, and dimensionality reduction.
- What you can do after
- Apply via PyTorch to implement mathematical transformations, construct training pipelines, optimize models, and compute projections or convolutions.
Read how Math and Architectures of Deep Learning explains PyTorch →
Optimization Algorithms: AI techniques for design, planning, and control problems
PyTorch is an open-source machine-learning library that provides tensor computation and automatic differentiation for building and training neural networks.
- How it is used
- Builds and trains actor and critic neural networks for CartPole reinforcement learning.
- How deep it goes
- Demonstrates network definitions, tensor-based action selection, advantage calculation, optimization, tracking, and visualization.
- Examples
- Uses CartPole actors and critics, episode-reward plots, and Stable-Baselines3 training and evaluation scripts.
- What you can do after
- Builds and trains a reinforcement-learning agent with custom PyTorch networks or Stable-Baselines3.
Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI
PyTorch is an open-source machine learning framework for tensor computation and neural-network development.
- How it is used
- Supports neural-network development and tensor computation for deep learning, including tabular prediction workflows.
- How deep it goes
- Compares PyTorch's stack role and toolkit options, but defers detailed layer definitions and implementation mechanics.
- Examples
- Uses Airbnb NYC price classification and compares framework stacks for tabular deep learning.
- What you can do after
- Evaluate/understand PyTorch ecosystem choices for building deep-learning solutions to tabular-data problems.
Read how Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI explains PyTorch →
Build a Large Language Model (From Scratch)
The deep learning library used here to normalize attention scores along a specified tensor dimension with softmax.
- How it is used
- Uses PyTorch to implement LLMs and support their pretraining or fine-tuning.
- How deep it goes
- Identifies PyTorch as the implementation library but defers comprehensive library instruction elsewhere.
- Examples
- Names BloombergGPT and medical question-answering models as examples of specialized custom LLMs.
- What you can do after
- Apply PyTorch to build LLMs and prepare them for pretraining or fine-tuning.
Read how Build a Large Language Model (From Scratch) explains PyTorch →
Build a Reasoning Model (From Scratch)
A deep learning library used here to represent tensors and define optimizers that minimize losses.
- How it is used
- Uses PyTorch to build and train neural networks within a pretrained-LLM text-generation workflow.
- How deep it goes
- Defines PyTorch and explains installation choices, but stops short of neural-network or tensor implementation details.
- Examples
- Uses requirements files, direct torch installation commands, and uv-based environment workflows.
- What you can do after
- Operate/configure PyTorch by selecting a compatible build and installing it with pip or uv.
Read how Build a Reasoning Model (From Scratch) explains PyTorch →
Related concepts
- PyTorch Geometricused by · PyTorch Geometric is an open-source Python library that extends PyTorch with data structures and operators for graph and geometric machine learning.
- fastaiused by · fastai is a high-level deep learning library built on PyTorch that provides layered abstractions for model development.
- to methodhas part · The PyTorch to method moves a tensor or module to a specified device and can change its data type.
- GPU kerneluses · A GPU kernel is an executable program or function that performs computation on a graphics processing unit, commonly using parallel threads.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.










