Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Siddhesh Prashant Chaubal

Dive into computer vision, natural language processing, and recommender systems by building end-to-end projects in PyTorch — one of the most widely used deep learning frameworks among researchers and engineers worldwide. This book takes you from the fundamentals to complete, hands-on projects, giving you the confidence to start creating your own AI solutions. The book begins with a chapter on the fundamentals of machine learning, laying the groundwork by introducing key aspects of an ML project such as data preprocessing, feature engineering, model training, and evaluation, along with essential concepts like overfitting and underfitting. The following chapter, "Tensors in PyTorch," explores data handling in PyTorch -- from basic tensor operations to advanced gradient computations -- providing a deeper understanding of data transformations. With the foundations in place, the book moves on to hands-on projects. Chapter 3 introduces you to the world of computer vision, where you will build an image classifier using convolutional neural networks. The next three chapters immerse you in natural language processing: beginning with text classification (Chapter 4), tackling a range of NLP tasks with Hugging Face (Chapter 5), and culminating in the creation of a storytelling language model (Chapter 6). The focus then shifts to other key AI domains – you will tackle an audio classification task (Chapter 7), build a recommender system in PyTorch (Chapter 8), and finish with a multi-modal project that combines computer vision and natural language processing to build an image captioning system (Chapter 9). Whether you're a software engineer looking to break into the world of AI or a beginner with basic Python skills, "AI Projects with PyTorch" offers practical guidance and hands-on experience to start building your own AI applications with confidence. Who this is book is for: Python programmers and software engineers who are new to AI and want…

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A hands-on, project-driven introduction to PyTorch that walks you from ML fundamentals through complete vision, NLP, audio, recommender, and multi-modal projects — ideal for Python programmers and software engineers new to AI who want to build real applications rather than just study theory. 【Book Arc】 - **Opening (~0%–6%)**: Lays the groundwork with a conceptual introduction to machine learning — data preprocessing, feature engineering, model training/evaluation, and overfitting/underfitting — using a relatable house-price prediction example to make abstract ideas concrete. - **Early (~6%–25%)**: Formalizes ML concepts (supervised learning, regression vs. classification, train/validation/test splits) and then dives into PyTorch tensors: creation, indexing, slicing, attributes (dtype, device, layout), and a bird's-eye view of operations, reinforced with hands-on manipulation exercises. - **Early–Middle (~25%–38%)**: Moves into computer vision with CNNs — explaining convolutions, filters, and the historical context (ImageNet, AlexNet, ResNets) before introducing the image classification project setup, including cross-entropy loss and batch normalization. - **Middle (~38%–47%)**: Builds out the CNN project with practical training techniques: early stopping to prevent overfitting, learning rate scheduling for better convergence, and transfer learning using a pretrained ResNet18 with a replaced final layer for the Oxford-IIIT Pet dataset. - **Late (~47%–53%+)**: Transitions to NLP, covering preprocessing, one-hot encodings vs. embeddings, text classification approaches, and the transformer architecture — setting up the text classification project that follows. (Excerpts thin out here; later chapters on Hugging Face, storytelling models, audio, recommender systems, and image captioning are mentioned in the blurb but not covered in detail in the sampled material.) 【Key Takeaways】 - **ML fundamentals are framed around a complete project lifecycle** (Early): The book teaches data splitting, feature types, and model evaluation as parts of one workflow, not isolated topics — so you learn *why* each step matters before you code. - **Feature engineering is positioned as a problem that neural networks solve** (Early): Instead of manually crafting polynomial features, networks like CNNs learn hierarchical features automatically — a key insight that motivates deep learning. - **Tensor mastery is built through practical exercises, not exhaustive reference** (Early): PyTorch has a huge API, so the book curates the most-used operations (indexing, slicing, creation patterns) and has you solve small problems to internalize them. - **CNNs are explained from first principles** (Middle): Convolutions, filters, and feature extraction are broken down with clear examples before you touch code, making the architecture intuitive rather than a black box. - **Training is treated as a craft with concrete techniques** (Middle): Early stopping (with patience and min_delta) and exponential learning rate decay are implemented and explained — showing how to avoid overfitting and improve convergence in practice. - **Transfer learning is a practical shortcut** (Middle): The image classifier uses a pretrained ResNet18 with frozen layers and a replaced final dense layer — a realistic approach for small datasets that saves training time and boosts accuracy. - **NLP is introduced with modern architecture in mind** (Late): The book covers embeddings vs. one-hot encodings and the transformer architecture, setting up text classification projects that go beyond simple bag-of-words models. 【Reading Tips】 - **Skim Chapter 1 if you have ML basics**: The house-price example and formal definitions are clear but introductory; focus on the overfitting/underfitting section, which recurs throughout the book. - **Deep-read the tensor exercises in Chapter 2**: These are the most transferable skills — spend time solving them yourself before checking answers, as they'll save you hours later. - **Pay close attention to the CNN training loop in Chapter 3**: Early stopping, learning rate scheduling, and transfer learning are patterns you'll reuse in every later project — understand the *why* behind each hyperparameter. - **Treat the NLP chapter as a bridge**: The transformer and embedding concepts are dense but essential; skim the optional RNN/LSTM section if you're short on time, as the book itself marks it as optional. - **Expect to code along**: This is a project book, not a reference — have a Python environment with PyTorch ready and run every example to get the full benefit. 【Coverage Limits】 This guide covers the sampled content through the CNN project and the start of NLP (up to ~53% of the book). Later chapters on Hugging Face, storytelling language models, audio classification, recommender systems, and image captioning are mentioned in the blurb but not detailed in the available excerpts.
Excerpt 1
ocessing to build an image captioning system (Chapter 9). Whether you're a software engineer looking to break into the world of AI or a beginner with basic P...
View in text
Excerpt 2
r validation. 8 Chapter 1 IntroduCtIon to MaChIne LearnIng It is clear that no straight line can model this dependence very well. However, allowing the model...
View in text
Excerpt 3
these operations that are most frequently used in practice. These exercises are not meant as supplementary material but form the most important part of this...
View in text
Excerpt 4
ns for learning rate scheduling in its torch.optim module. Here, we use the exponential learning rate scheduler, which decays the learning rate after every e...
View in text
Excerpt 5
should collate together the different samples into a batch. This is achieved using a collate function that is passed as an argument to the DataLoader. We wri...
View in text
Excerpt 6
device_train_batch_size and per_device_eval_batch_size, as the names suggest, define the batch size to be used per GPU or CPU for training and evaluation, re...
View in text
Excerpt 7
ng documents gets challenging; one strategy we used in our Wikipedia article summarization project was to break the text into smaller, overlapping chunks tha...
View in text
Excerpt 8
er('tril', torch.tril(torch.ones(config.block_size, config.block_size))) This is responsible for creating and registering our causal mask, which is essential...
View in text
Tags
AI categories
PythonAIProgramming Language
ISBN: 8868821176
Publisher: Apress
Publish Year: 2026
Language: English
Pages: 359
File Format: PDF
File Size: 3.7 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…