Deep Learning · TEE · section

Sequence mappings and applications

Recurrent neural networks

Definition. A sequence-model configuration specifies how many inputs and outputs are processed and how their time indices relate. One-to-many, many-to-one and many-to-many configurations correspond to different prediction tasks.

Explanation and working

The number and timing of inputs and outputs determine the sequence mapping Tap the diagram to enlarge.
MappingMeaningExample and output
One to manyOne input conditions several outputsImage captioning: image to a word sequence
Many to oneSequence summarized as one outputReview sentiment: words to positive neutral or negative
Many to many alignedOutput associated with each input timeVideo frame labeling or per-word tagging
Many to many unalignedOutput sequence length may differEncoder-decoder translation

Music generation can use earlier notes to predict the next note repeatedly. Next-word prediction uses the prefix to produce a probability distribution over a vocabulary. A word with the largest predicted probability is a simple choice, but the precise prediction cannot be calculated without the learned model's weights.

Sentence explanation: In “The dogs that bark near my house are loud,” the model should retain the plural subject across the intervening words when choosing “are”. Gates can retain subject information and admit later context. This is an interpretation of what a trained model may learn, not a claim that an individual gate is guaranteed to represent grammar.

Sentiment model answer: tokenize the review, map tokens to numerical embeddings, process them with an RNN/LSTM/GRU, use a final state or pooled sequence representation, then a dense layer and softmax over three sentiment classes. Train with categorical cross-entropy on labeled reviews; evaluate on held-out data. A bidirectional model is not needed for this answer and is not explicitly listed in the current syllabus.