Generative AI with Python and PyTorch

by Joseph Babcock, Raghav Bali

Artificial Intelligence

Book Details

Book Title

Generative AI with Python and PyTorch Navigating the AI frontier with LLMs, Stable Diffusion

Author

Joseph Babcock, Raghav Bali

Publisher

Packt

Publication Date

2025

ISBN

9781835884447

Number of Pages

580

Language

English

Format

PDF

File Size

7.81MB

Subject

Computers > Algorithms and Data Structures: Pattern Recognition

Table of Contents

  • Preface
  • Introduction to Generative AI: Drawing Data from Models
  • Discriminative versus generative models
  • Implementing generative models
  • The rules of probability
  • Discriminative and generative modeling, and Bayes’ theorem
  • Why generative models?
  • Unique challenges of generative models
  • Summary
  • References
  • Building Blocks of Deep Neural Networks
  • Perceptrons: A brain in a function
  • Multilayer perceptrons and backpropagation
  • Varieties of networks: convolution and recursive
  • Networks for sequential data
  • Transformers
  • Building a better optimizer
  • Summary
  • References
  • The Rise of Methods for Text Generation
  • Text representation
  • Text generation and the magic of LSTMs
  • LSTM variants and convolutions for text
  • Summary
  • References
  • NLP 2.0: Using Transformers to Generate Text
  • Attention
  • Self-attention
  • Transformers
  • NLP tasks and transformer architectures
  • DistilBERT in action
  • Text generation with GPT
  • Summary
  • References
  • Join our communities on Discord and Reddit
  • LLM Foundations
  • Recap: Transformer architectures
  • Updated training setup
  • Instruction fine-tuning
  • Hands-on: Instruction tuning
  • Reinforcement Learning with Human Feedback (RLHF)
  • Hands-on: RLHF using PPO
  • LLMs
  • Summary
  • Open-Source LLMs
  • The LLaMA models
  • Mixtral
  • Dolly
  • Falcon
  • Grok-1
  • Summary
  • References
  • Join our communities on Discord and Reddit
  • Prompt Engineering
  • Prompt engineering
  • Prompting techniques
  • Cross-domain prompting
  • Adversarial prompting
  • Limitations of prompt engineering
  • Summary
  • References
  • LLM Toolbox
  • The LangChain ecosystem
  • Building a simple LLM application
  • Creating complex applications with LangGraph
  • Summary
  • References
  • Join our communities on Discord and Reddit
  • LLM Optimization Techniques
  • Why optimize?
  • Pre-training optimizations
  • Fine-tuning optimizations
  • Inference time improvements
  • Emerging trends and research areas
  • Summary
  • References
  • Emerging Applications in Generative AI
  • Advances in model development
  • New usages for LLMs
  • Summary
  • References
  • Neural Networks Using VAEs
  • Creating separable encodings of images
  • The variational objective
  • The reparameterization trick
  • Inverse autoregressive flow
  • Importing CIFAR
  • Creating the network in PyTorch
  • Summary
  • References
  • Join our communities on Discord and Reddit
  • Image Generation with GANs
  • Generative adversarial networks
  • Vanilla GAN
  • Improved GANs
  • Challenges
  • Summary
  • References
  • Join our communities on Discord and Reddit
  • Style Transfer with GANs
  • Pix2Pix-GAN: paired style transfer
  • CycleGAN: unpaired style transfer
  • Summary
  • References
  • Join our communities on Discord and Reddit
  • Deepfakes with GANs
  • Deepfakes overview
  • Modes of operation
  • Key feature set
  • High-level workflow
  • Re-enactment using Pix2Pix
  • Challenges
  • Off-the-shelf implementations
  • Summary
  • References
  • Join our communities on Discord and Reddit
  • Diffusion Models and AI Art
  • A walk through image generation: Why we need diffusion models
  • Running Stable Diffusion in the cloud
  • Deep dive into the text-to-image pipeline
  • Summary
  • References
  • Join our communities on Discord and Reddit
  • Other Books You May Enjoy
  • Index