Image captioning

Greedy search
Used in machine translation example by Andrew NG
This approach just picks the next word that is most likely at each step. However, by making local “best” choices, it might miss globally optimal sequences. For instance, the phrase “Jane is going” might seem likely initially, but it can lead to less fluent translations.
Beam search
Instead of relying on pure greedy tactics, beam search keeps track of several possible sequences (beams) and tries to find the best among them. It’s a compromise between pure greedy search and exhaustive search, making it both efficient and more accurate than just greedy search.
Sets a hyperparameter B (beam width)
Beam search picks top 'B' words based on their probablilities
It calculates probability of each new sequence by multiplying probaility of previous sequence with probability of new word, then selects top B most likely sequences to continue to the next step
Uses NN to evaluate probabilities at each step
Refinements to beam search
- Log probability stabilization

The probabilities are very small (less than 1) tou multiplying these small numbers can results in tiny product, leading to numerical underflow
To avoid underflow, we take log of probabilities
- Length normalization
Maximizing log probabilities tends to favour shorter sequences, as they involve fewer multiplications of numbers less than one
We normalize the log probability by length of sequence, objective becomes average log probability per word, reducing penalty for longer sequences
- Soft normalization

Adjust sum of log probabilities by dividing by term
a is a hyperparameter
Typical values are 0.7
Error analysis in Beam search

BLEU score
(Bilingual evaluation understudy) is used to evaluate quality of machine translation
Since Machine translations can have multiple valid translations, bleu score helps address this by comparing machine generated translations to translations provided by humans

Bigram precision

Combined BLEU score
= bleu score on n-grams only


Attention for sequence generation



Speech recognition

process of converting audio clips into text transcripts. It begins with microphones capturing changes in air pressure, which are then represented as audio clips over time. These clips undergo a pre-processing step where they're converted into spectrograms, displaying frequency versus time. Traditionally, speech recognition relied on phonemes, which are basic hand-engineered units of sound. However, modern approaches use end-to-end deep learning, directly converting audio to text without an intermediate phoneme representation. The effectiveness of these systems heavily depends on large datasets, with the best models training on over 10,000 hours of transcribed audio. Two prominent models in this field are the Attention Model, which focuses on different parts of the audio for accurate transcription, and the Connectionist Temporal Classification (CTC) model, which allows for alignment of audio with shorter text by using blank characters. The continued advancement in speech recognition is primarily driven by the availability of large datasets and the development of sophisticated deep learning algorithms.
Trigger word detection
