UNIT 5
Variational Auto encoders
�Architecture of Variational Autoencoder�
Example
VAE is a special kind of autoencoder that can generate new data instead of just compressing and reconstructing it.
1. Encoder (Understanding the Input)
2. Latent Space (Adding Some Randomness)
3. Decoder (Reconstructing or Creating New Data)
�1. Encoder (Understanding the Input)�
The encoder takes input data like images or text and learns its key features. Instead of outputting one fixed value, it produces two vectors for each feature:
These two values define a range of possibilities instead of a single number.
��2. Latent Space (Adding Some Randomness)�
z∼N(μ,σ2)
�3. Decoder (Reconstructing or Creating New Data)�
Transformers
Example
Components of Transformer
��Architecture of Transformer��
The Transformer model consists of two main components:
1. Encoder
Encoder consists of multiple layers and each layer is composed of two main sub-layers:
���
2. Decoder
Each decoder layer consists of three main sub-layers:
1.Masked Self-Attention Mechanism
2.Encoder-Decoder Attention Mechanism
3.Feed-Forward Neural Network
��How Transformers Work�
1. Input Representation
The first step in processing input data involves converting raw text into a format that the transformer model can understand. This involves tokenization and embedding.
2. Encoder Process in Transformers
3. Decoder Process
4. Training and Inference
Training
Inference
No teacher forcing (model uses its own predictions)
Generates output token by token (step-by-step)
��Applications�