From convolutional networks to the attention mechanism that powers ChatGPT -- these memory tricks lock in the deep learning architectures that define modern AI.
Or continue to the sub-topics below for more specialized Study Rooms and Forums
Proven Mnemonics & Acronyms — fast to learn, hard to forget.
# BERT = encoder only (understanding tasks)
# GPT = decoder only (generation tasks)
# T5 = encoder + decoder (translation, summarization)
from transformers import BertModel, GPT2Model
bert = BertModel.from_pretrained("bert-base-uncased")# BERT = encoder only (understanding tasks)
# GPT = decoder only (generation tasks)
# T5 = encoder + decoder (translation, summarization)
from transformers import BertModel, GPT2Model
bert = BertModel.from_pretrained("bert-base-uncased")import torch.nn as nn
class ResidualBlock(nn.Module):
def forward(self, x):
return self.layers(x) + x # skip connection
# The + x is the residual connection — the key innovationimport torch.nn as nn
class ResidualBlock(nn.Module):
def forward(self, x):
return self.layers(x) + x # skip connection
# The + x is the residual connection — the key innovation# Using Hugging Face diffusers library
from diffusers import StableDiffusionPipeline
pipe = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")
image = pipe("a photorealistic cat on the moon").images[0]# Using Hugging Face diffusers library
from diffusers import StableDiffusionPipeline
pipe = StableDiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")
image = pipe("a photorealistic cat on the moon").images[0]# RLHF is not easily reproducible in a snippet
# The three phases conceptually:
# 1. sft_model = finetune(base_llm, instruction_demos)
# 2. reward_model = train(human_preference_data)
# 3. rlhf_model = ppo_train(sft_model, reward_model)# RLHF is not easily reproducible in a snippet
# The three phases conceptually:
# 1. sft_model = finetune(base_llm, instruction_demos)
# 2. reward_model = train(human_preference_data)
# 3. rlhf_model = ppo_train(sft_model, reward_model)