
Dive into Deep Learning(读书笔记)
文章平均质量分 77
读书笔记:《动手学深度学习》PyTorch 英文版
Fiona-Dong
这个作者很懒,什么都没留下…
展开
-
(二)Linear Neural Networks -- 4. Implementation of Softmax Regression from Scratch
4. Implementation of Softmax Regression from Scratch Just as we implemented linear regression from scratch, softmax regression is similarly fundamental. We will work with the Fashion-MNIST dataset, which has 10 classes. import torch from torch import nn, o转载 2021-02-17 14:42:29 · 195 阅读 · 0 评论 -
(二)Linear Neural Networks -- 3. The Image Classification Dataset
3. The Image Classification Dataset import torch import torchvision from torchvision import transforms from torch.utils import data import matplotlib.pyplot as plt %matplotlib inline 3.1 Reading the Dataset Download and read the Fashion-MNIST dataset int转载 2021-01-31 15:29:29 · 160 阅读 · 0 评论 -
(二)Linear Neural Networks -- 2. Concise Implementation of Linear Regression
2. Concise Implementation of Linear Regression 2.1 Generating the Dataset Generate the same dataset as in Linear Regression Implementation from Scratch: import numpy as np import torch from torch.utils import data from torch import nn def synthetic_data(w转载 2021-01-18 22:27:19 · 156 阅读 · 0 评论 -
(二)Linear Neural Networks -- 1. Linear Regression Implementation from Scratch
1. Linear Regression Implementation from Scratch 1.1 Generating the Dataset To keep things simple, we will construct an artificial dataset according to a linear model with additive noise. Our task will be to recover this model’s parameters using the finite转载 2021-01-17 19:29:55 · 204 阅读 · 0 评论 -
(一)Preliminaries -- 2. Automatic Differentiation
2. Automatic Differentiation import torch 2.1 Backward for Non-Scalar Variables # Same as `x = torch.arange(4.0, requires_grad=True)` x = torch.arange(4.0) x.requires_grad_(True) # The default value is None print(x.grad) None y = 2 * torch.dot(x, x) y.b转载 2021-01-17 15:46:12 · 128 阅读 · 0 评论 -
(一)Preliminaries -- 1. Data Manipulation
1. Data Manipulation import torch 1.1 Getting started torch.arange() x = torch.arange(12) print(x.shape) print(x.numel()) torch.Size([12]) 12 X = x.reshape(3, 4) print(X.shape) X = x.reshape(3, 4)... torch.Size([3, 4]) torch.zeros/ones/rand/tensor() x转载 2021-01-11 21:45:26 · 207 阅读 · 0 评论