[Andrej Karpathy] Building makemore Part 3: Activations & Gradients, BatchNorm
🎯 Загружено автоматически через бота:
🚫 Оригинал видео:
📺 Данное видео принадлежит каналу «Andrej Karpathy» (@AndrejKarpathy). Оно представлено в нашем сообществе исключительно в информационных, научных, образовательных или культурных целях. Наше сообщество не утверждает никаких прав на данное видео. Пожалуйста, поддержите автора, посетив его оригинальный канал.
✉️ Если у вас есть претензии к авторским правам на данное видео, пожалуйста, свяжитесь с нами по почте support@, и мы немедленно удалим его.
📃 Оригинальное описание:
We dive into some of the internals of MLPs with multiple layers and scrutinize the statistics of the forward pass activations, backward pass gradients, and some of the pitfalls when they are improperly scaled. We also look at the typical diagnostic tools and visualizations you’d want to use to understand the health of your deep network. We learn why training deep neural nets can be fragile and introduce the first modern innovation that made doing so much easier: Batch Normalization. Residual connections and the Adam optimizer remain notable todos for later video.
Links:
makemore on github:
jupyter notebook I built in this video:
collab notebook:
my website:
my twitter:
Discord channel:
Useful links:
“Kaiming init“ paper:
BatchNorm paper:
Bengio et al. 2003 MLP language model paper (pdf):
Good paper illustrating some of the problems with batchnorm in practice:
Exercises:
E01: I did not get around to seeing what happens when you initialize all weights and biases to zero. Try this and train the neural net. You might think either that 1) the network trains just fine or 2) the network doesn’t train at all, but actually it is 3) the network trains but only partially, and achieves a pretty bad final performance. Inspect the gradients and activations to figure out what is happening and why the network is only partially training, and what part is being trained exactly.
E02: BatchNorm, unlike other normalization layers like LayerNorm/GroupNorm etc. has the big advantage that after training, the batchnorm gamma/beta can be “folded into“ the weights of the preceeding Linear layers, effectively erasing the need to forward it at test time. Set up a small 3-layer MLP with batchnorms, train the network, then “fold“ the batchnorm gamma/beta into the preceeding Linear layer’s W,b by creating a new W2, b2 and erasing the batch norm. Verify that this gives the same forward pass during inference. i.e. we see that the batchnorm is there just for stabilizing the training, and can be thrown out after training is done! pretty cool.
Chapters:
intro
starter code
fixing the initial loss
fixing the saturated tanh
calculating the init scale: “Kaiming init”
batch normalization
batch normalization: summary
real example: resnet50 walkthrough
summary of the lecture
just kidding: part2: PyTorch-ifying the code
viz #1: forward pass activations statistics
viz #2: backward pass gradient statistics
the fully linear case of no non-linearities
viz #3: parameter activation and gradient statistics
viz #4: update:data ratio over time
bringing back batchnorm, looking at the visualizations
summary of the lecture for real this time
5 views
0
0
2 months ago 01:55:57 5
[Andrej Karpathy] Building makemore Part 3: Activations & Gradients, BatchNorm
2 months ago 01:55:23 12
[Andrej Karpathy] Building makemore Part 4: Becoming a Backprop Ninja
2 months ago 00:56:21 4
[Andrej Karpathy] Building makemore Part 5: Building a WaveNet
2 months ago 01:56:19 72
[Andrej Karpathy] Let’s build GPT: from scratch, in code, spelled out.
2 months ago 00:59:47 11
[Andrej Karpathy] [1hr Talk] Intro to Large Language Models
2 months ago 04:01:25 13
[Andrej Karpathy] Let’s reproduce GPT-2 (124M)
2 months ago 02:13:34 2
[Andrej Karpathy] Let’s build the GPT Tokenizer
2 months ago 00:03:19 1
How To Study Hard - Richard Feynman
2 months ago 00:26:10 1
Attention in transformers, visually explained | Chapter 6, Deep Learning
2 months ago 00:27:14 1
How large language models work, a visual intro to transformers | Chapter 5, Deep Learning
3 months ago 00:27:13 10
But what is a GPT? Visual intro to transformers | Chapter 5, Deep Learning
3 months ago 00:44:17 1
No Priors Ep. 80 | With Andrej Karpathy from OpenAI and Tesla
4 months ago 00:18:11 67
НОВОСТИ ИИ: Подписка на ChatGPT за 2000$
4 months ago 00:06:53 1
Elon Musk says losers use LiDAR. [Explanation video]
5 months ago 00:47:27 1
Projeto Secreto da OpenAI: Descubra as Últimas Inovações da IA e Fique Super Atualizado no IA News#6
5 months ago 00:07:41 1
Educação 100% com IA, FBI invade celular, Hype das IA no fim, e muito mais
8 months ago 00:40:08 1
The Most Important Algorithm in Machine Learning
8 months ago 00:08:29 1
CATL’s sodium hybrid battery will be 30% cheaper & revolutionise the world
8 months ago 00:08:55 1
Tesla reveals timelline for massive electric Semi production at $ factory
10 months ago 00:26:53 1
Vedal & Neuro Build A Language Model From Scratch
10 months ago 00:16:39 1
Phi-1: A ’Textbook’ Model
11 months ago 00:20:13 1
GPT-5: Everything You Need to Know So Far
1 year ago 00:14:07 1
“Что в имени тебе моем?“ Учимся генерировать новые имена у звездного разработчика Tesla и OpenAI.
1 year ago 00:59:48 22
Введение в большие языковые модели от Andrej Karpathy