liveBook · Manning

PyTorch

As explained in 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.

PyTorch provides tensor-based tools for defining and training neural networks. In reinforcement learning, it expresses actor and critic models, forward passes, losses, and optimizer updates in executable Python. section 12.3

CartPole with A2C

Create an environment, derive its state and action dimensions, instantiate actor and critic networks, train for 500 episodes, and record returns. A higher-level alternative uses Stable-Baselines3 with Gymnasium and A2C or PPO.

How Optimization Algorithms: AI techniques for design, planning, and control problems covers it

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 it assumes
Assumes familiarity with reinforcement-learning environments, policies, values, rewards, and actor–critic terminology.
What you can do after
Builds and trains a reinforcement-learning agent with custom PyTorch networks or Stable-Baselines3.
How it connects
Connects neural networks with reinforcement learning, A2C, PPO, Gymnasium, categorical distributions, and Adam optimization.

Also explained in

Compare how 11 books explain PyTorch →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Optimization Algorithms: AI techniques for design, planning, and control problems. The section links point to the parts of the book it draws on.