Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Generative AI with Python and PyTorch

You're reading from   Generative AI with Python and PyTorch Hands-on projects and cutting-edge techniques using generative adversarial networks and LLMs

Arrow left icon
Product type Paperback
Published in Jan 2025
Publisher Packt
ISBN-13 9781835884447
Length 500 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Joseph Babcock Joseph Babcock
Author Profile Icon Joseph Babcock
Joseph Babcock
Raghav Bali Raghav Bali
Author Profile Icon Raghav Bali
Raghav Bali
Arrow right icon
View More author details
Toc

Transformers

While we will discuss this topic in more detail in Chapter 9, NLP 2.0: Using Transformers to Generate Text, it important to note that Convolutional and Recursive Units have been replaced in many current applications by Transformers, a type of architecture first described in 2017. In a way, transformers combine the strengths of both recursive and convolutional networks. Like convolutional networks, they compute relative similarity between elements in a sequence or matrix; but unlike convolutional networks they perform this calculation between all elements rather than just locally. Like LSTMs, they preserve a context window through positional encoding elements, the all-to-all pairwise similarity (also known as self-attention), and pass through connections that resemble the memory units in LSTMs. However, unlike LSTMs, they can computed in parallel, enabling more efficient training.

Figure 2.17 Gives an overview of how this remarkable operation works; each element in a sequence...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime