动手学深度学习 v2.0介绍。 lr = 0.03 num_epochs = 3 net = linreg loss = squared_loss for epoch in range(num_epochs): for X, y in data_iter(batch_size, features, labels): l = loss(net(X, w, b), y) # X和y的小批量损失 # 因为l形状是(batch_size sum().backward() sgd([w, b], lr, batch_size) # 使用参数的梯度更新参数 with torch.no_grad(): train_l = loss(net(features, w, b), labels) print(f'epoch {epoch + 1}, loss {float(train_l.mean()):f}') 3.2. 线性回归的从零开始实现 要工程师花一个月的时间重新开始编写网页,那并不高效。 对于标准深度学习模型,我们可以使用框架的预定义好的层。这使我们只需关注使用哪些层来构造模型,而 不必关注层的实现细节。我们首先定义一个模型变量net,它是一个Sequential类的实例。Sequential类将多 个层串联在一起。当给定输入数据时,Sequential实例将数据传入到第一层,然后将第一层的输出作为第二 层的输入,以此类推。0 码力 | 797 页 | 29.45 MB | 1 年前3
pytorch 入门笔记-03- 神经网络import torch import torch.nn as nn import torch.nn.functional as F class Net(nn.Module): def __init__(self,): super(Net, self).__init__() # 输入图片通道数为 1,输出通道数为 6,卷积核大小为 (5, 5) self = 1 for s in size: num_features *= s return num_features net = Net() print(net) Net( (conv1): Conv2d(1, 6, kernel_size=(5, 5), stride=(1, 1)) (conv2): Conv2d(6, 16, kernel_size=(5 函数(用来计算梯度)会被 autograd 自动创建。 可以在 forward 函数中使用任何针对 Tensor 的操作。 net.parameters() 返回可被学习的参数(权重)列表和值 原文链接:pytorch 入门笔记 -03- 神经网络 params = list(net.parameters()) print(len(params)) print(params[0].size()) #0 码力 | 7 页 | 370.53 KB | 1 年前3
复杂环境下的视觉同时定位与地图构建http://www.zjucvg.net/ls-acts/ls-acts.html • RKSLAM: • http://www.zjucvg.net/rkslam/rkslam.html • RDSLAM: • http://www.zjucvg.net/rdslam/rdslam.html • ACTS: • http://www.zjucvg.net/acts/acts.html zju.edu.cn/home/gfzhang: Email: zhangguofeng@cad.zju.edu.cn ZJUCVG Group Website: http:www.zjucvg.net:0 码力 | 60 页 | 4.61 MB | 1 年前3
【PyTorch深度学习-龙龙老师】-测试版202112Segmentation) 是通过算法自动分割并识别出图片中的内容,可以 将语义分割理解为像素点的分类问题,分析每个像素点的物体的类别信息,如图 1.16 所 示。常见的语义分割模型有 FCN、U-net、PSPNet、DeepLab 系列等。 预览版202112 1.4 深度学习应用 11 图 1.15 目标检测效果图 图 1.16 语义分割效果图 视频理解(Video + ?2 ?2 + ⋯ + ?? ?? + ? 其中?称为感知机的偏置(Bias),一维向量? = [?1, ?2, … , ??]称为感知机的权值(Weight),? 称为感知机的净活性值(Net Activation)。 ?1 ?2 ? ?? ? ?1 ?2 ? ?? 输入? 输出 图 6.1 感知机模型 上式写成向量形式: name 由 TensorFlow 内部维护,使用的比较少。我们实例化 MyDense 类,并查看其参数列表,例 如: In [5]: net = MyDense(4,3) # 创建输入为 4,输出为 3 节点的自定义层 net.variables,net.trainable_variables # 查看自定义层的参数列表 Out[5]: # 类的全部参数列表 ([0 码力 | 439 页 | 29.91 MB | 1 年前3
机器学习课程-温州大学-06深度学习-优化算法opt_SGD = torch.optim.SGD(net_SGD.parameters(), lr=LR) opt_Momentum = torch.optim.SGD(net_Momentum.parameters(), lr=LR, momentum=0.9) opt_RMSProp = torch.optim.RMSprop(net_RMSProp.parameters(), lr=LR lr=LR, alpha=0.9) opt_Adam = torch.optim.Adam(net_Adam.parameters(), lr=LR, betas=(0.9, 0.99)) 15 Pytorch的优化器 16 神经网络的局部最优问题 17 局部最优问题 18 01 小批量梯度下降 02 优化算法 03 超参数调整和BatchNorm 040 码力 | 31 页 | 2.03 MB | 1 年前3
机器学习课程-温州大学-08深度学习-深度卷积神经网络始参数。迁移学习是深度学习中非常重要和常用的⼀个策略。 4.卷积神经网络使用技巧 29 迁移学习步骤 1.使用预训练的模型 net = models.resnet18(pretrained=True) 2.冻结模型权重 for param in net.parameters(): #遍历每个模型参数 param.requires_grad = False #参数梯度为False 3.替换全连接层 # 将最后的全连接层改成十分类 device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") net.fc = nn.Linear(512, 10) 4.卷积神经网络使用技巧 30 参考文献 • IAN GOODFELLOW等,《深度学习》,人民邮电出版社,2017 • Andrew Ng,http://www Large-Scale Image Recognition (Karen Simonyan and Andrew Zisserman, 2015) • GoogLeNet/Inception Net:Going Deeper with Convolutions (Christian Szegedy et al., 2015) • ResNet:Deep Residual Learning for0 码力 | 32 页 | 2.42 MB | 1 年前3
Machine Learning Pytorch Tutorial__init__() self.net = nn.Sequential( nn.Linear(10, 32), nn.Sigmoid(), nn.Linear(32, 1) ) def forward(self, x): return self.net(x) Initialize your __init__() self.net = nn.Sequential( nn.Linear(10, 32), nn.Sigmoid(), nn.Linear(32, 1) ) def forward(self, x): return self.net(x) import torch0 码力 | 48 页 | 584.86 KB | 1 年前3
深度学习下的图像视频处理技术-沈小勇??? ???????????? ????????????0 ???????????? ME ????????????????????????→0 SPMC Detail Fusion Net Our Method 48 ???????????????????????? ???????????? ????????????0 ???????????? ME ?????????? inaccurate kernels inaccurate models unstable solvers information loss Efficient Network Structure U-Net or encoder-decoder network [Su et al, 2017] Remaining Challenges 82 Input Output conv skip connection EDRB3 Param 2.66M 3.76M 2.21M 2.99M 3.76M PSNR 28.11 29.06 28.60 29.32 29.98 Scale Recurrent with U-Net (SR-ED) ????????????3 ????????????2 Solver ????????????3 Solver Solver ????????????2 ??????0 码力 | 121 页 | 37.75 MB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 2 - Compression TechniquesThere are other works in the literature that demonstrate different variants of quantization. XNOR-Net4, Binarized Neural Networks5 and others use b=1, and thus have binary weight matrices. The quantization Advances in neural information processing systems 29 (2016). 4 Rastegari, Mohammad, et al. "Xnor-net: Imagenet classification using binary convolutional neural networks." European conference on computer for unoptimized representation (float) and quantized representation (8-bit) using a convolutional net trained on the CIFAR-10 dataset. Project: Quantizing A Deep Learning Model We have worked through0 码力 | 33 页 | 1.96 MB | 1 年前3
QCon北京2018-《从键盘输入到神经网络--深度学习在彭博的应用》-李碧野exponential growth of data © 2018 Bloomberg Finance L.P. All rights reserved. bli59@bloomberg.net xyu34@bloomberg.net QUESTIONS?0 码力 | 64 页 | 13.45 MB | 1 年前3
共 21 条
- 1
- 2
- 3













