This is the seventh day of my participation in the First Challenge 2022
Before writing, let’s look at two common drawing methods of RNN. The one on the left is drawn separately according to time steps, and the one on the right is sketched.
RNNs
one-one
It’s just a normal neural network. I won’t go over it
one-many
When do you need one input (or even no input) to get multiple outputs?
For example, build tasks. Text generation, AI composition and so on.
Take AI composition as an example. Type in the style you want and automatically generate a piece of music. Amazon’s AWS DeepComposer, for example
AWS DeepComposer provides an innovative way for developers to start using machine learning. Completely converted to the melody of the original song in seconds, all without writing any code.
Start using the AWS DeepComposer keyboard to create melodies that can be fully converted into original songs in seconds, with all the support provided by AI. AWS DeepComposer is designed to provide training for developers, including tutorials, sample code, and training data that you can use to start building a generative AI model, all without writing any code.
many-one
The most typical many-to-one is sentiment analysis, sentiment categorization, etc., where you type in a sentence and get the corresponding sentiment categorization.
Input: the general feeling of this machine is good, practical: solar calendar display, time and date fast conversion, notepad, etc.
Output: positive
many-many
Many-to-many is equal length and unequal length. Equal length is named entity recognition or entity labeling, and unequal length is machine translation.
Entity labeling:
Input: U.S. Defense Secretary Jim Mattis says military exercises with Seoul, called Foal Eagle, take place every spring in South Korea but will be ‘scaled back’ in 2019
Defense Secretary [Mattis]PER said the military exercise with the [Seoul]GPE, called Foal Eagle, takes place at the [South Korean]GPE every spring, but TMP will be “scaled back” [in 2019].
Pos tagging:
Input: The quick brown fox jumps over the lazy dog
Output: [fast] VA [of] DEC [brown] NN [fox] NN [skip] VV [up] AS [lazy] VA [of] DEC [dog] NN
The thing to notice here is that this diagram is input and output, not that there is output for one input or that there are multiple outputs for one input. This first processing input data and then unified output is encoder-decoder.
Machine Translation:
Input: The United States and China may soon reach a trade agreement.
The United States and China may soon reach a trade agreement.
Text Summary:
Input: Starbucks, which entered the Chinese market earlier, is the favorite brand of many xiaozi. In China, Starbucks is much more “high-end” than it is in the United States. A medium americano with the same ingredients costs only 12 yuan in the United States, but 21 yuan in China, which is 75% more expensive. China Business News
Output: Media reports say starbucks’ American style coffee is 75% more expensive in China than in the US.
The final figure for this article.
- The article mainly refers to Andrej Karpathy’sThe Unreasonable Effectiveness of Recurrent Neural Network.