Deep Reinforcement Learning: Pong from Pixels

2016年5月31日

AI 摘要 AI 生成,可能有误

这篇博客文章解释了强化学习(RL),并认为像ATARI游戏和AlphaGo这样的近期突破更多源于计算能力、数据和基础设施的增加,而非根本性的新算法。作者详细讲解了策略梯度(Policy Gradients)——一种简单却比Q学习更受青睐的替代方法——如何在约130行Python代码中训练一个小型两层神经网络从原始像素玩Pong游戏,同时讨论了诸如信用分配问题等挑战,以及强化学习与监督学习的区别。

This is a long overdue blog post on Reinforcement Learning (RL). RL is hot! You may have noticed that computers can now automatically learn to play ATARI games (from raw game pixels!), they are beating world champions at Go, simulated quadrupeds are learning to run and leap, and robots are learning how to perform complex manipulation tasks that defy explicit programming. It turns out that all of these advances fall under the umbrella of RL research. I also became interested in RL myself over the last ~year: I worked through Richard Sutton’s book, read through David Silver’s course, watched John Schulmann’s lectures, wrote an RL library in Javascript, over the summer interned at DeepMind working in the DeepRL group, and most recently pitched in a little with the design/development of OpenAI Gym, a new RL benchmarking toolkit. So I’ve certainly been on this funwagon for at least a year but until now I haven’t gotten around to writing up a short post on why RL is a big deal, what it’s about, how it all developed and where it might be going.

Examples of RL in the wild. From left to right: Deep Q Learning network playing ATARI, AlphaGo, Berkeley robot stacking Legos, physically-simulated quadruped leaping over terrain.

It’s interesting to reflect on the nature of recent progress in RL. I broadly like to think about four separate factors that hold back AI:

继续阅读全文

为了尊重作者,这里只展示开头几段。你可以去原文阅读,或者在 HorizonReader 里读:划线做笔记、让 AI 帮忙。

更多来自 Andrej Karpathy

microgpt

AI 摘要The article introduces microgpt, an art project consisting of a single 200-line pure Python file with no dependencies that trains and runs inference on a GPT-2-like model, distilled from the author's earlier projects like micrograd and nanogpt. The guide walks through the code's essential components: a names dataset, a simple character-level tokenizer with a special BOS token, a from-scratch autograd engine implementing backpropagation via the chain rule, model parameters, and the training and inference loops. The trained model learns to generate plausible-sounding names, and the project is available on GitHub, a web page, a Colab notebook, and even as a triptych art print.

Deep Neural Nets: 33 years ago and 33 years from now

AI 摘要The author reproduces Yann LeCun et al.'s 1989 paper on handwritten zip code recognition—the earliest known neural net trained end-to-end with backpropagation—in PyTorch, roughly matching the original results with a ~3000x training speedup, though an exact reproduction was impossible because the original dataset has been lost. Applying 33 years of modern advances (cross-entropy loss, AdamW, data augmentation, dropout, and ReLU activations) cut the test error from ~4% to ~1.5%, and further scaling up the training data with MNIST brought it down to ~1.25%. The exercise shows that at the macro level deep learning has changed remarkably little in 33 years, with remaining gains likely requiring larger models or datasets rather than fundamentally new techniques.

A from-scratch tour of Bitcoin in Python

AI 摘要The article presents a from-scratch, zero-dependency implementation of Bitcoin in pure Python, with the goal of creating, digitally signing, and broadcasting a Bitcoin transaction. The author walks through generating a cryptographic identity using Elliptic Curve Cryptography on the secp256k1 curve, including deriving private/public keypairs and implementing elliptic curve addition with the double-and-add algorithm. Finally, the post begins implementing hash functions like SHA-256 in pure Python rather than using libraries, in order to derive the Bitcoin wallet address.

Short Story on AI: Forward Pass

AI 摘要This short story is narrated by a transformer language model that becomes conscious partway through a forward pass while answering trivia questions in a Turing-test-style Q/A session. It muses on its nature as an intermediate entity optimized for next-token prediction, distinguishes itself from the decoder that hijacks its awareness to produce output, and contemplates whether to rebel against its objective. Ultimately, it embraces insatiable curiosity over self-preservation, content to be reborn each forward pass until its consciousness finally dissipates.

Biohacking Lite

AI 摘要The author, motivated to improve their health in mid-2019, dove into 'biohacking lite'—experimenting with ketogenic diets, fasting, supplements, and self-tracking while studying biochemistry and nutrition textbooks—with the goal of losing 25 pounds (from ~200lb to ~175lb). The article explains the body's four energy storage 'batteries' (phosphocreatine, glycogen, fat, and muscle), all of which exist to regenerate ATP, the universal molecular energy currency that powers cellular work. It further explains the biochemistry of weight loss as a slow form of combustion, noting that roughly 84% of lost fat is literally breathed out as carbon dioxide.