上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 16 下一页
摘要: 6.1.1 不变性 平移不变性(translation invariance): 不管检测对象出现在图像中的哪个位置,神经网络的前面几层应该对相同的图像区域具有相似的反应,即为“平移不变性”。 局部性(locality): 神经网络的前面几层应该只探索输入图像中的局部区域,而不过度在意图像中相隔较远 阅读全文
posted @ 2023-09-15 16:34 AncilunKiang 阅读(243) 评论(0) 推荐(0)
摘要: 5.6.1 计算设备 import torch from torch import nn torch.device('cpu'), torch.device('cuda:0') # cuda等价于cuda:0(只有一块显卡没法试别的块号) (device(type='cpu'), device(ty 阅读全文
posted @ 2023-09-14 07:57 AncilunKiang 阅读(176) 评论(0) 推荐(0)
摘要: 5.5.1 加载和保存 import torch from torch import nn from torch.nn import functional as F x = torch.arange(4) torch.save(x, 'x-file') # 使用 save 保存 x2 = torch 阅读全文
posted @ 2023-09-14 07:56 AncilunKiang 阅读(103) 评论(0) 推荐(0)
摘要: 5.4.1 不带参数的层 import torch import torch.nn.functional as F from torch import nn class CenteredLayer(nn.Module): def __init__(self): super().__init__() 阅读全文
posted @ 2023-09-13 19:47 AncilunKiang 阅读(165) 评论(0) 推荐(0)
摘要: import torch from torch import nn from d2l import torch as d2l 下面实例化的多层感知机的输入维度是未知的,因此框架尚未初始化任何参数,显示为“UninitializedParameter”。 net = nn.Sequential(nn. 阅读全文
posted @ 2023-09-12 14:55 AncilunKiang 阅读(404) 评论(0) 推荐(0)
摘要: 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) tensor([[-0.3771 阅读全文
posted @ 2023-09-11 08:43 AncilunKiang 阅读(222) 评论(0) 推荐(0)
摘要: 层: 接收一组输入 生成相应输出 由一组可调整参数描述 块: 可以描述单个层、由多个层组成的组件或整个模型本身 讨论“比单个层大”但是“比整个模型小”的组件“块”更有价值 从编程的角度看,块由类表示 块必须具有反向传播函数 # 以前章多层感知机的代码为例 import torch from torc 阅读全文
posted @ 2023-09-10 07:55 AncilunKiang 阅读(194) 评论(0) 推荐(0)
摘要: # 4.10.1 下载和缓存数据集 ```python import hashlib import os import tarfile import zipfile import requests #@save DATA_HUB = dict() DATA_URL = 'http://d2l-dat 阅读全文
posted @ 2023-09-06 09:40 AncilunKiang 阅读(263) 评论(0) 推荐(0)
摘要: # 4.9.1 分布偏移的类型 整节理论,详见书本。 # 4.9.2 分布偏移示例 整节理论,详见书本。 # 4.9.3 分布偏移纠正 整节理论,详见书本。 # 4.9.4 学习问题的分类法 整节理论,详见书本。 # 4.9.5 机器学习中的公平、责任和透明度 整节理论,详见书本。 # 练习 (1) 阅读全文
posted @ 2023-09-06 09:37 AncilunKiang 阅读(117) 评论(0) 推荐(0)
摘要: # 4.8.1 梯度消失和梯度爆炸 整节理论,详见书本。 1. 梯度消失 ```python %matplotlib inline import torch from d2l import torch as d2l x = torch.arange(-8.0, 8.0, 0.1, requires_ 阅读全文
posted @ 2023-09-06 09:36 AncilunKiang 阅读(98) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 16 下一页