Reader small image

You're reading from  Hands-On Image Generation with TensorFlow

Product typeBook
Published inDec 2020
Reading LevelIntermediate
PublisherPackt
ISBN-139781838826789
Edition1st Edition
Languages
Right arrow
Author (1)
Soon Yau Cheong
Soon Yau Cheong
author image
Soon Yau Cheong

Soon Yau Cheong is an AI consultant and the founder of Sooner.ai Ltd. With a history of being associated with industry giants such as NVIDIA and Qualcomm, he provides consultation in the various domains of AI, such as deep learning, computer vision, natural language processing, and big data analytics. He was awarded a full scholarship to study for his PhD at the University of Bristol while working as a teaching assistant. He is also a mentor for AI courses with Udacity.
Read more about Soon Yau Cheong

Right arrow

Self-attention modules

Self-attention modules became popular with the introduction of an NLP model known as the Transformer. In NLP applications such as language translation, the model often needs to read sentences word by word to understand them before producing the output. The neural network used prior to the advent of the Transformer was some variant on the recurrent neural network (RNN), such as long short-term memory (LSTM). The RNN has internal states to remember words as it reads a sentence.

One drawback of that is that when the number of words increases, the gradients for the first words vanish. That is to say, the words at start of the sentence become less important gradually as the RNN reads more words.

The Transformer does things differently. It reads all the words at once and weights the importance of each individual word. Therefore, more attention is given to words that are more important, and hence the name attention. Self-attention is a cornerstone of state-of...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Hands-On Image Generation with TensorFlow
Published in: Dec 2020Publisher: PacktISBN-13: 9781838826789

Author (1)

author image
Soon Yau Cheong

Soon Yau Cheong is an AI consultant and the founder of Sooner.ai Ltd. With a history of being associated with industry giants such as NVIDIA and Qualcomm, he provides consultation in the various domains of AI, such as deep learning, computer vision, natural language processing, and big data analytics. He was awarded a full scholarship to study for his PhD at the University of Bristol while working as a teaching assistant. He is also a mentor for AI courses with Udacity.
Read more about Soon Yau Cheong