Convert Figma logo to code with AI

d2l-ai logod2l-zh

《动手学深度学习》:面向中文读者、能运行、可讨论。中英文版被70多个国家的500多所大学用于教学。

61,188
10,842
61,188
84

Top Related Projects

This project reproduces the book Dive Into Deep Learning (https://d2l.ai/), adapting the code from MXNet into PyTorch.

VIP cheatsheets for Stanford's CS 230 Deep Learning

13,480

AI education materials for Chinese students, teachers and IT professionals.

《机器学习》(西瓜书)公式详解

21,489

The fastai book, published as Jupyter Notebooks

6,106

TensorFlow documentation

Quick Overview

D2L-zh is the Chinese version of the "Dive into Deep Learning" (D2L) textbook. It's an interactive, comprehensive resource for learning deep learning, combining theory with hands-on coding examples. The repository contains the source code for the book, including text content, code samples, and exercises.

Pros

  • Comprehensive coverage of deep learning concepts and techniques
  • Interactive learning experience with Jupyter notebooks
  • Regular updates to keep content current with the latest developments
  • Available for free, promoting accessibility to deep learning education

Cons

  • Primarily focused on the Chinese language, which may limit accessibility for non-Chinese speakers
  • Some advanced topics may be challenging for beginners
  • Requires a significant time investment to work through all the material

Code Examples

Since this is not a code library but rather an educational resource, we'll skip the code examples section. The repository itself contains numerous code examples within its Jupyter notebooks, but these are meant to be part of the learning experience rather than standalone usage examples.

Getting Started

To get started with D2L-zh:

  1. Clone the repository:

    git clone https://github.com/d2l-ai/d2l-zh.git
    
  2. Install the required dependencies:

    pip install -r requirements.txt
    
  3. Navigate to the desired chapter's directory and open the Jupyter notebooks to start learning.

Note: Ensure you have Jupyter installed on your system to interact with the notebooks effectively.

Competitor Comparisons

This project reproduces the book Dive Into Deep Learning (https://d2l.ai/), adapting the code from MXNet into PyTorch.

Pros of d2l-pytorch

  • Focuses specifically on PyTorch implementation, making it more accessible for PyTorch users
  • Provides a more streamlined and focused learning experience for those interested in PyTorch
  • May offer more up-to-date PyTorch-specific best practices and techniques

Cons of d2l-pytorch

  • Limited to PyTorch, lacking the broader framework coverage of d2l-zh
  • Potentially smaller community and less frequent updates compared to the more established d2l-zh
  • May not cover as wide a range of topics as the comprehensive d2l-zh repository

Code Comparison

d2l-pytorch:

import torch
from torch import nn

net = nn.Sequential(nn.Linear(20, 256), nn.ReLU(), nn.Linear(256, 10))
X = torch.randn(2, 20)
net(X)

d2l-zh:

import tensorflow as tf

net = tf.keras.models.Sequential([
    tf.keras.layers.Dense(256, activation='relu'),
    tf.keras.layers.Dense(10)
])
X = tf.random.normal((2, 20))
net(X)

The main difference is the use of PyTorch in d2l-pytorch versus TensorFlow in d2l-zh, reflecting their respective focus on different deep learning frameworks.

VIP cheatsheets for Stanford's CS 230 Deep Learning

Pros of stanford-cs-230-deep-learning

  • Concise and focused content, providing quick reference sheets for deep learning concepts
  • Covers specific Stanford CS230 course material, beneficial for students taking or reviewing the course
  • Includes visual aids and diagrams to enhance understanding

Cons of stanford-cs-230-deep-learning

  • Less comprehensive than d2l-zh, which offers a full textbook-like experience
  • Limited code examples and practical implementations compared to d2l-zh
  • May not be as frequently updated as d2l-zh, which is actively maintained

Code Comparison

stanford-cs-230-deep-learning (limited code snippets):

# No substantial code examples available

d2l-zh (example of code implementation):

import torch
from torch import nn

net = nn.Sequential(nn.Linear(4, 8), nn.ReLU(), nn.Linear(8, 1))
X = torch.rand(size=(2, 4))
net(X)

The d2l-zh repository provides more extensive code examples and implementations, while stanford-cs-230-deep-learning focuses on theoretical concepts and visual representations.

13,480

AI education materials for Chinese students, teachers and IT professionals.

Pros of ai-edu

  • Broader scope covering various AI topics beyond deep learning
  • More practical examples and hands-on projects
  • Stronger focus on industry applications and real-world scenarios

Cons of ai-edu

  • Less structured curriculum compared to d2l-zh
  • Not as frequently updated as d2l-zh
  • Primarily in Chinese, limiting accessibility for non-Chinese speakers

Code Comparison

d2l-zh example (PyTorch):

def train_epoch(net, train_iter, loss, updater):
    net.train()
    for X, y in train_iter:
        y_hat = net(X)
        l = loss(y_hat, y)
        updater.zero_grad()
        l.backward()
        updater.step()

ai-edu example (TensorFlow):

def train_step(model, optimizer, x_train, y_train):
    with tf.GradientTape() as tape:
        predictions = model(x_train, training=True)
        loss = loss_object(y_train, predictions)
    gradients = tape.gradient(loss, model.trainable_variables)
    optimizer.apply_gradients(zip(gradients, model.trainable_variables))

Both repositories provide valuable resources for learning AI and deep learning. d2l-zh offers a more structured approach with a focus on deep learning, while ai-edu covers a broader range of AI topics with more practical examples. The choice between them depends on the learner's specific needs and preferences.

《机器学习》(西瓜书)公式详解

Pros of pumpkin-book

  • Focuses specifically on machine learning algorithms and their mathematical foundations
  • Provides detailed derivations and explanations of complex concepts
  • Includes hand-written notes and illustrations for better understanding

Cons of pumpkin-book

  • Less comprehensive coverage of deep learning topics compared to d2l-zh
  • Fewer practical coding examples and hands-on exercises
  • Limited to Chinese language, which may restrict its accessibility to non-Chinese speakers

Code comparison

While both repositories are primarily focused on theoretical content, d2l-zh provides more code examples. Here's a brief comparison:

pumpkin-book (limited code snippets):

# No significant code examples available

d2l-zh (more code-oriented):

import torch

def softmax(X):
    X_exp = torch.exp(X)
    partition = X_exp.sum(1, keepdim=True)
    return X_exp / partition

Both repositories serve as valuable resources for machine learning enthusiasts, with pumpkin-book excelling in mathematical foundations and d2l-zh offering a more comprehensive and practical approach to deep learning.

21,489

The fastai book, published as Jupyter Notebooks

Pros of fastbook

  • More comprehensive coverage of deep learning applications, including computer vision, NLP, and tabular data
  • Focuses on practical implementation using the fastai library, which simplifies many complex tasks
  • Includes more interactive Jupyter notebooks for hands-on learning

Cons of fastbook

  • Less emphasis on theoretical foundations compared to d2l-zh
  • Primarily uses PyTorch, which may limit exposure to other frameworks
  • May be less suitable for readers seeking a rigorous mathematical approach

Code Comparison

fastbook example (PyTorch with fastai):

from fastai.vision.all import *
path = untar_data(URLs.PETS)/'images'
def is_cat(x): return x[0].isupper()
dls = ImageDataLoaders.from_name_func(
    path, get_image_files(path), valid_pct=0.2, seed=42,
    label_func=is_cat, item_tfms=Resize(224))

d2l-zh example (MXNet):

from d2l import mxnet as d2l
from mxnet import autograd, np, npx
npx.set_np()

def synthetic_data(w, b, num_examples):
    X = np.random.normal(0, 1, (num_examples, len(w)))
    y = np.dot(X, w) + b
    y += np.random.normal(0, 0.01, y.shape)
    return X, y.reshape((-1, 1))
6,106

TensorFlow documentation

Pros of docs

  • Comprehensive official documentation for TensorFlow
  • Regularly updated with the latest TensorFlow features and APIs
  • Covers a wide range of topics, from beginner to advanced

Cons of docs

  • Focuses solely on TensorFlow, lacking broader machine learning concepts
  • May be overwhelming for beginners due to its extensive coverage

Code Comparison

docs:

import tensorflow as tf

model = tf.keras.Sequential([
  tf.keras.layers.Dense(64, activation='relu'),
  tf.keras.layers.Dense(10, activation='softmax')
])

d2l-zh:

import torch
from torch import nn

net = nn.Sequential(
    nn.Linear(784, 256),
    nn.ReLU(),
    nn.Linear(256, 10)
)

Key Differences

  • d2l-zh provides a more comprehensive introduction to deep learning concepts
  • docs is specific to TensorFlow, while d2l-zh covers multiple frameworks
  • d2l-zh includes interactive Jupyter notebooks for hands-on learning
  • docs offers more in-depth coverage of TensorFlow-specific features and tools

Target Audience

  • docs: Developers and researchers focused on TensorFlow
  • d2l-zh: Students and practitioners learning deep learning fundamentals

Learning Approach

  • docs: API-centric, focusing on TensorFlow usage
  • d2l-zh: Concept-driven, emphasizing understanding of underlying principles

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

动手学深度学习(Dive into Deep Learning,D2L.ai)

第二版:zh.D2L.ai | 第一版:zh-v1.D2L.ai | 安装和使用书中源代码: 第二版 第一版

理解深度学习的最佳方法是学以致用。

本开源项目代表了我们的一种尝试:我们将教给读者概念、背景知识和代码;我们将在同一个地方阐述剖析问题所需的批判性思维、解决问题所需的数学知识,以及实现解决方案所需的工程技能。

我们的目标是创建一个为实现以下目标的统一资源:

  1. 所有人均可在网上免费获取;
  2. 提供足够的技术深度,从而帮助读者实际成为深度学习应用科学家:既理解数学原理,又能够实现并不断改进方法;
  3. 包含可运行的代码,为读者展示如何在实际中解决问题。这样不仅直接将数学公式对应成实际代码,而且可以修改代码、观察结果并及时获取经验;
  4. 允许我们和整个社区不断快速迭代内容,从而紧跟仍在高速发展的深度学习领域;
  5. 由包含有关技术细节问答的论坛作为补充,使大家可以相互答疑并交换经验。
将本书(中英文版)用作教材或参考书的大学

如果本书对你有帮助,请Star (★) 本仓库或引用本书的英文版:

@book{zhang2023dive,
    title={Dive into Deep Learning},
    author={Zhang, Aston and Lipton, Zachary C. and Li, Mu and Smola, Alexander J.},
    publisher={Cambridge University Press},
    note={\url{https://D2L.ai}},
    year={2023}
}

本书的英文版

虽然纸质书已出版,但深度学习领域依然在迅速发展。为了得到来自更广泛的英文开源社区的帮助,从而提升本书质量,本书的新版将继续用英文编写,并搬回中文版。

欢迎关注本书的英文开源项目。

中英文教学资源

加州大学伯克利分校 2019 年春学期 Introduction to Deep Learning 课程教材(同时提供含教学视频地址的中文版课件)。

学术界推荐

"Dive into this book if you want to dive into deep learning!"

— 韩家炜,ACM 院士、IEEE 院士,美国伊利诺伊大学香槟分校计算机系 Michael Aiken Chair 教授

"This is a highly welcome addition to the machine learning literature."

— Bernhard Schölkopf,ACM 院士、德国国家科学院院士,德国马克斯•普朗克研究所智能系统院院长

"书中代码可谓‘所学即所用’。"

— 周志华,ACM 院士、IEEE 院士、AAAS 院士,南京大学计算机科学与技术系主任

"这本书可以帮助深度学习实践者快速提升自己的能力。"

— 张潼,ASA 院士、IMS 院士,香港科技大学计算机系和数学系教授

工业界推荐

"一本优秀的深度学习教材,值得任何想了解深度学习何以引爆人工智能革命的人关注。"

— 黄仁勋,NVIDIA创始人 & CEO

"《动手学深度学习》是最适合工业界研发工程师学习的。我毫无保留地向广大的读者们强烈推荐。"

— 余凯,地平线公司创始人 & CEO

"强烈推荐这本书!我特别赞赏这种手脑一体的学习方式。"

— 漆远,复旦大学“浩清”教授、人工智能创新与产业研究院院长

"《动手学深度学习》是一本很容易让学习者上瘾的书。"

— 沈强,将门创投创始合伙人

贡献

感谢社区贡献者们为每一位读者改进这本开源书。

如何贡献 | 致谢 | 讨论或报告问题 | 其他