Skip to product information
A Complete Guide to Using Transformer with PyTorch in 10 Easy Projects
A Complete Guide to Using Transformer with PyTorch in 10 Easy Projects
Description
Book Introduction
Mastering step-by-step projects
How to use the Hugging Face Transformer!


You can experience a balanced approach that covers not only the basic theory of transformers but also practical application implementation through 10 projects.
We'll guide you through the core processes of Transformer, including natural language processing, computer vision, speech recognition, reinforcement learning, and multimodality, as well as various machine learning/deep learning tasks.
The introduction explains the inner workings of the transformer architecture and its main models, while subsequent chapters cover pretraining, fine-tuning, and practical examples of open-source models.
In particular, it provides separate chapters on the HuggingFace ecosystem, transfer learning, model deployment, and serving to help even beginners learn about the Transformer model easily. It also includes best practices and debugging guidance for Transformer models using PyTorch and HuggingFace for practitioners.
","
index
Chapter 1 Transformer Architecture

_01.1 NLP Model Development History
__01.1.1 Recurrent Neural Network (RNN)
__01.1.2 LSTM
__01.1.3 RNN Encoder-Decoder
__01.1.4 Attention Mechanism
_01.2 Transformer Architecture
__01.2.1 Embedding
__01.2.2 Positional Encoding
__01.2.3 Model input
__01.2.4 Encoder layer
__01.2.5 Attention Mechanism
_01.3 Transformer Learning Process
_01.4 Transformer Inference Process
_01.5 Transformer Types and Applications
__01.5.1 Encoder-only model
__01.5.2 Decoder-only model
__01.5.3 Encoder-Decoder Model

Chapter 2: The Hugging Face Ecosystem

_02.1 Hugging Face Overview
__02.1.1 Main Components
__02.1.2 Tokenizer
__02.1.3 Creating a Custom Tokenizer
__02.1.4 Using the Hugging Face Pre-trained Tokenizer
_02.2 Datasets library
__02.2.1 Using the Hugging Face Dataset
__02.2.2 Using the Hugging Face Dataset in PyTorch
_02.3 Model Fine Tuning
__02.3.1 Preferences
__02.3.2 Learning
__02.3.3 Inference
_02.4 Sharing the Hugging Face Model
__02.4.1 Model Sharing
__02.4.2 Using Spaces

Chapter 3 PyTorch Transformer Model

_03.1 PyTorch Transformer Components
_03.2 Embedding
__03.2.1 Implementing the embedding layer
_03.3 Positional encoding
_03.4 Masking
_03.5 Transformer Encoder Components
_03.6 Transformer Decoder Components
_03.7 PyTorch Transformer Layer

Chapter 4: Transfer Learning with PyTorch and HuggingFace

_04.1 The Need for Transfer Learning
_04.2 How to Use Transfer Learning
_04.3 Pre-trained model repository
_04.4 Pre-training model
__04.4.1 Natural Language Processing (NLP)
__04.4.2 Computer Vision
__04.4.3 Voice Processing
_04.5 Project 1: Creating a Classifier by Fine-Tuning the BERT-base-uncased Model
__04.5.1 Custom Dataset Class
__04.5.2 Creating a DataLoader
__04.5.3 Inference

Chapter 5 Large-Scale Language Models

_05.1 Large-Scale Language Model (LLM)
_05.2 Key factors determining performance
__05.2.1 Network size: Number of encoder and decoder layers
_05.3 Leading LLM
__05.3.1 BERT and related models
__05.3.2 GPT
__05.3.3 BART
_05.4 Creating a Custom LLM
__05.4.1 Clincal-BERT Implementation

Chapter 6: Transformer NLP Tasks

_06.1 NLP Task
_06.2 Text classification
__06.2.1 Architecture suitable for text classification
__06.2.2 Text classification using transformer fine-tuning
__06.2.3 Long sequence processing
__06.2.4 Document Chunking Implementation Example
__06.2.5 Hierarchical Attention Implementation Example
_06.3 Text Generation
__06.3.1 Project 2: Generating Text That Sounds Like Shakespeare
_06.4 Transformer Chatbot
__06.4.1 Project 3: Clinic Question Answering (AI Doctor) Transformer
_06.5 Learning with PEFT and LoRA

Chapter 7 Computer Vision (CV) Models

_07.1 Image Preprocessing
__07.1.1 Image preprocessing example
_07.2 Vision Transformer Architecture
__07.2.1 Project 4: AI Ophthalmologist
_07.3 Distillation Transformer
__07.3.1 DeiT's pre-learning process
__07.3.1 Advantages of DeiT
_07.4 Detection Transformer
__07.4.1 Project 5: Object Detection Model

Chapter 8: Transformer Computer Vision Tasks

_08.1 Computer Vision Tasks
__08.1.1 Image Classification
__08.1.2 Image Segmentation
__08.1.3 Project 6: Image Segmentation for a Diet Calculator
_08.2 Diffusion Model: Unconditional Image Generation
__08.2.1 Forward Diffusion
__08.2.2 Backward Diffusion
__08.2.3 Inference Process
__08.2.4 Learnable Parameters
__08.2.5 Implementing the DogGenDiffuion Project

Chapter 9 Voice Processing Model

_09.1 Voice Processing
__09.1.1 Voice preprocessing example
_09.2 Whisper Model
__09.2.1 Whisper_Nep model development process
_09.3 Wav2Vec model
__09.3.1 Wav2Vec application
_09.4 Speech T5 Model
__09.4.1 Input/Output Representation
__09.4.2 Cross-modal presentation
__09.4.3 Encoder-Decoder Architecture
__09.4.4 Pre-study
__09.4.5 Fine Tuning and Applications
_09.5 Comparison of Whisper, Wav2Vec 2.0, and SpeechT5

Chapter 10: Transformer Voice Processing Tasks

_10.1 Voice Processing Tasks
__10.1.1 Speech to text
__10.1.2 Project 7: Speech to Text Conversion Using Whisper
_10.2 Text to Speech
__10.2.1 Project 8: Text to Speech
_10.3 Audio to Audio Conversion
__10.3.1 Project 9: Improving Audio Quality with Noise Reduction

Chapter 11: Transformers for Table Data Processing

_11.1 Processing Table Data Using Transformers
__11.1.1 TAPAS Architecture
_11.2 TabTransformer Architecture
_11.3 FT Transformer Architecture
__11.3.1 Feature Tokenizer
__11.3.2 Merging numeric and categorical features
__11.3.3 Transformer

Chapter 12: Transformers for Regression and Classification Tasks on Tabular Data

_12.1 Transformer for classification work
__12.1.1 dataset
__12.1.2 Target Variables
__12.1.3 Data Preprocessing
__12.1.4 Settings
__12.1.5 Training and Evaluation with Three Models
__12.1.6 Evaluation Results
__12.1.7 Analysis
_12.2 Transformer for regression tasks
__12.2.1 Dataset
__12.2.2 Data Preprocessing
__12.2.3 Settings
__12.2.4 Learning and Evaluation

Chapter 13 Multimodal Transformers

_13.1 Multimodal Architecture
__13.1.1 ImageBind
__13.1.2 CLIP
_13.2 Multimodal work
__13.2.1 Feature Extraction
__13.2.2 Text to Image
__13.2.3 Image to Text
__13.2.4 Visual Question Answering

Chapter 14: Transformer Reinforcement Learning

_14.1 Reinforcement Learning
_14.2 PyTorch Techniques (Models) for Reinforcement Learning
__14.2.1 Stable Baseline3
__14.2.2 Gymnasium
_14.3 How to Perform Reinforcement Learning
_14.4 Transformers for Reinforcement Learning
__14.4.1 Decision Transformer
__14.4.2 Trajectory Transformer

Chapter 15: Exporting, Serving, and Deploying Models

_15.1 Project 10: Exporting and Serializing Models
__15.1.1 Exporting and Importing PyTorch Models
__15.1.2 Saving multiple models
_15.2 Exporting models to ONNX format
_15.3 Serving Models with FastAPI
__15.3.1 Advantages of FastAPI
__15.3.2 FastAPI Application for Model Serving
__15.3.3 FastAPI for serving semantic segmentation models
_15.4 Serving PyTorch Models on Mobile Devices
_15.5 Deploying the HuggingFace Transformer Model on AWS
__15.5.1 Deploying via Amazon SageMaker
__15.5.2 Deploying via AWS Lambda and Amazon API Gateway

Chapter 16: Transformer Model Interpretability and Visualization

_16.1 Explainability vs. Interpretability Concepts
__16.1.1 Interpretability
__16.1.2 Explainability
_16.2 Explainability and Interpretability Tools
_16.3 CAPTUM for Transformer Prediction Analysis
__16.3.1 Loading the model
__16.3.2 Input Preparation
__16.3.3 Layer Integral Gradient
__16.3.4 Visualization
_16.4 TensorBoard for PyTorch Models

Chapter 17: Best Practices and Debugging PyTorch Models

_17.1 Best Practices for Implementing Transformer Models
__17.1.1 Using Hugging Face
__17.1.2 General Considerations for PyTorch Models
_17.2 PyTorch Debugging Techniques
__17.2.1 Syntax error
__17.2.2 Runtime Error
__17.2.3 Logical Error
__17.2.4 General Guidelines for Debugging PyTorch ML Models
","
Detailed image
Detailed Image 1
","
Publisher's Review
★10 Projects Covered in This Book★

1. Create a classifier by fine-tuning the BERT-base-uncased model.
2.
Generate text that sounds like Shakespeare
3. Creating an AI Clinic Q&A Chatbot
4.
Implementing AI doctors in ophthalmology
5.
Creating a program for object detection
6.
Implementing a diet calculator that classifies food photos
7.
Voice to Text Conversion with Whisper
8.
Text-to-speech conversion using SpeechT5
9.
Improve audio quality with noise removal
10.
Exporting and Serializing PyTorch Models

★10 Key Keywords Covered in This Book★

1.
Transformer architecture
2.
Hugging Face Ecosystem
3.
PyTorch-based model implementation
4.
transfer learning
5. LLM (Large-Scale Language Model)
6. NLP tasks (text classification and generation)
7.
Computer Vision Transformer Model
8.
Voice Processing Transformer
9.
Multimodal transformer
10.
Model serving and distribution

★This book's target audience★

* Data scientists who need full guidelines for the HuggingFace Transformer model and library.
* AI engineers who are curious about practical projects in various fields such as natural language processing, computer vision, and speech recognition.
* Project managers who need to understand AI and machine learning project management and implementation
* Anyone who wants to know how transformer models are used in deep learning and machine learning!

★Amazon Readers' Recommendations★

This book systematically presents insightful, advanced techniques that leverage the powerful capabilities of PyTorch and HuggingFace.
A suitable reference book for deep learning enthusiasts who want to delve deeper into the practical applications of transformers.
The content is well-structured and thoroughly engaging for readers interested in cutting-edge machine learning technologies.
- sunita

This is a great resource if you want to start building Transformer-based models and develop projects related to NLP, vision, and audio.
This book provides complete code examples that you can run and practice with, and includes quizzes to help you test your knowledge.
Overall, it's a very good book.
- Ganesh

The book begins by detailing the Transformer model architecture.
The full journey covers several practical examples for implementing the model.
Covers everything from creating basic custom tokenizers to computer vision, speech processing, and multimodal projects.
All code examples are provided as ready-to-run Google Colab files, making it easy for anyone to follow along and build their own projects.
If you're interested in learning more about Transformer models but feel overwhelmed by the sheer volume of content, this book is the perfect "learn by doing" guide, guiding you through a logical sequence and providing easy-to-follow code examples.
- fabio santana
"]
GOODS SPECIFICS
- Date of issue: February 7, 2025
- Page count, weight, size: 292 pages | 170*232*20mm
- ISBN13: 9791193083277
- ISBN10: 1193083273

You may also like

카테고리