Deep Learning with PyTorch
Vishnu Subramanian
- English
- ePUB (mobile friendly)
- Available on iOS & Android
Deep Learning with PyTorch
Vishnu Subramanian
About This Book
Build neural network models in text, vision and advanced analytics using PyTorchAbout This Book⢠Learn PyTorch for implementing cutting-edge deep learning algorithms.⢠Train your neural networks for higher speed and flexibility and learn how to implement them in various scenarios;⢠Cover various advanced neural network architecture such as ResNet, Inception, DenseNet and more with practical examples;Who This Book Is ForThis book is for machine learning engineers, data analysts, data scientists interested in deep learning and are looking to explore implementing advanced algorithms in PyTorch. Some knowledge of machine learning is helpful but not a mandatory need. Working knowledge of Python programming is expected.What You Will Learn⢠Use PyTorch for GPU-accelerated tensor computations⢠Build custom datasets and data loaders for images and test the models using torchvision and torchtext⢠Build an image classifier by implementing CNN architectures using PyTorch⢠Build systems that do text classification and language modeling using RNN, LSTM, and GRU⢠Learn advanced CNN architectures such as ResNet, Inception, Densenet, and learn how to use them for transfer learning⢠Learn how to mix multiple models for a powerful ensemble model⢠Generate new images using GAN's and generate artistic images using style transferIn DetailDeep learning powers the most intelligent systems in the world, such as Google Voice, Siri, and Alexa. Advancements in powerful hardware, such as GPUs, software frameworks such as PyTorch, Keras, Tensorflow, and CNTK along with the availability of big data have made it easier to implement solutions to problems in the areas of text, vision, and advanced analytics.This book will get you up and running with one of the most cutting-edge deep learning librariesâPyTorch. PyTorch is grabbing the attention of deep learning researchers and data science professionals due to its accessibility, efficiency and being more native to Python way of development. You'll start off by installing PyTorch, then quickly move on to learn various fundamental blocks that power modern deep learning. You will also learn how to use CNN, RNN, LSTM and other networks to solve real-world problems. This book explains the concepts of various state-of-the-art deep learning architectures, such as ResNet, DenseNet, Inception, and Seq2Seq, without diving deep into the math behind them. You will also learn about GPU computing during the course of the book. You will see how to train a model with PyTorch and dive into complex neural networks such as generative networks for producing text and images. By the end of the book, you'll be able to implement deep learning applications in PyTorch with ease.Style and approachAn end-to-end guide that teaches you all about PyTorch and how to implement it in various scenarios.
Frequently asked questions
Information
Deep Learning with Sequence Data and Text
- Different representations of text data that are useful for building deep learning models
- Understanding recurrent neural networks (RNNs) and different implementations of RNNs, such as Long Short-Term Memory (LSTM) and Gated Recurrent Unit (GRU), which power most of the deep learning models for text and sequential data
- Using one-dimensional convolutions for sequential data
- Document classifiers: Identifying the sentiment of a tweet or review, classifying news articles
- Sequence-to-sequence learning: For tasks such as language translations, converting English to French
- Time-series forecasting: Predicting the sales of a store given details about previous days' store details
Working with text data
- Natural language understanding
- Document classification
- Sentiment classification
- Convert text into words and represent each word as a vector
- Convert text into characters and represent each character as a vector
- Create n-gram of words and represent them as vectors
Tokenization
Converting text into characters
thor_review = "the action scenes were top notch in this movie. Thor has never been this epic in the MCU. He does some pretty epic sh*t in this movie and he is definitely not under-powered anymore. Thor in unleashed in this, I love that."
print(list(thor_review))
#Results
['t', 'h', 'e', ' ', 'a', 'c', 't', 'i', 'o', 'n', ' ', 's', 'c', 'e', 'n', 'e', 's', ' ', 'w', 'e', 'r', 'e', ' ', 't', 'o', 'p', ' ', 'n', 'o', 't', 'c', 'h', ' ', 'i', 'n', ' ', 't', 'h', 'i', 's', ' ', 'm', 'o', 'v', 'i', 'e', '.', ' ', 'T', 'h', 'o', 'r', ' ', 'h', 'a', 's', ' ', 'n', 'e', 'v', 'e', 'r', ' ', 'b', 'e', 'e', 'n', ' ', 't', 'h', 'i', 's', ' ', 'e', 'p', 'i', 'c', ' ', 'i', 'n', ' ', 't', 'h', 'e', ' ', 'M', 'C', 'U', '.', ' ', 'H', 'e', ' ', 'd', 'o', 'e', 's', ' ', 's', 'o', 'm', 'e', ' ', 'p', 'r', 'e', 't', 't', 'y', ' ', 'e', 'p', 'i', 'c', ' ', 's', 'h', '*', 't', ' ', 'i', 'n', ' ', 't', 'h', 'i', 's', ' ', 'm', 'o', 'v', 'i', 'e', ' ', 'a', 'n', 'd', ' ', 'h', 'e', ' ', 'i', 's', ' ', 'd', 'e', 'f', 'i', 'n', 'i', 't', 'e', 'l', 'y', ' ', 'n', 'o', 't', ' ', 'u', 'n', 'd', 'e', 'r', '-', 'p', 'o', 'w', 'e', 'r', 'e', 'd', ' ', 'a', 'n', 'y', 'm', 'o', 'r', 'e', '.', ' ', 'T', 'h', 'o', 'r', ' ', 'i', 'n', ' ', 'u', 'n', 'l', 'e', 'a', 's', 'h', 'e', 'd', ' ', 'i', 'n', ' ', 't', 'h', 'i', 's', ',', ' ', 'I', ' ', 'l', 'o', 'v', 'e', ' ', 't', 'h', 'a', 't', '.']
Converting text into words
print(Thor_review.split())
#Results
['the', 'action', 'scenes', 'were', 'top', 'notch', 'in', 'this', 'movie.', 'Thor', 'has', 'never', 'been', 'this', 'epic', 'in', 'the', 'MCU.', 'He', 'does', 'some', 'pretty', 'epic', 'sh*t', 'in', 'this', 'movie', 'and', 'he', 'is', 'definitely', 'not', 'under-powered', 'anymore.', 'Thor', 'in', 'unleashed', 'in', 'this,', 'I', 'love', 'that.']
N-gram representation
from nltk import ngrams
print(list(ngrams(thor_review.split(),2)))
#Results
[('the', 'action'), ('action', 'scenes'), ('scenes', 'were'), ('were', 'top'), ('top', 'notch'), ('notch', 'in'), ('in', 'this'), ('this', 'movie.'), ('movie.', 'Thor'), ('Thor', 'has'), ('has', 'never'), ('never', 'been'), ('been', 'this'), ('this', 'epic'), ('epic', 'in'), ('in', 'the'), ('the', 'MCU.'), ('MCU.', 'He'), ('He', 'does'), ('does', 'some'), ('some', 'pretty'), ('pretty', 'epic'), ('e...