动手学深度学习 v2.0import Image from torch import nn from torch.nn import functional as F from torch.utils import data from torchvision import transforms 目标受众 本书面向学生(本科生或研究生)、工程师和研究人员,他们希望扎实掌握深度学习的实用技术。因为我们 从头开始解 编写了一个“学习”程序。如果我们用一个巨大的带标签的数 据集,它很可能可以“学习”识别唤醒词。这种“通过用数据集来确定程序行为”的方法可以被看作用数据 编程(programming with data)。比如,我们可以通过向机器学习系统,提供许多猫和狗的图片来设计一个 “猫图检测器”。检测器最终可以学会:如果输入是猫的图片就输出一个非常大的正数,如果输入是狗的图片 就会输出一个非常小的负数 学习的一个主要分支,本节稍后的内容将对其 进行更详细的解析。 1.2 机器学习中的关键组件 首先介绍一些核心组件。无论什么类型的机器学习问题,都会遇到这些组件: 1. 可以用来学习的数据(data); 2. 如何转换数据的模型(model); 3. 一个目标函数(objective function),用来量化模型的有效性; 4. 调整模型参数以优化目标函数的算法(algorithm)。0 码力 | 797 页 | 29.45 MB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 1 - Introductionthere might not be a single algorithm that works perfectly, and there is a large amount of unseen data that the algorithm needs to process. Unlike traditional algorithm problems where we expect exact optimal certainty the exact content that you would end up clicking on, at that particular moment, with more data and sophisticated algorithms, these models can be trained to be fairly accurate over a longer term Availability of labelled data Even if one has enough compute, and sophisticated algorithms, solving classical machine learning problems relies on the presence of sufficient labeled data. With deep learning0 码力 | 21 页 | 3.17 MB | 1 年前3
【PyTorch深度学习-龙龙老师】-测试版2021120.01 的高斯分布: ? = 1. ? + . + ?, ? ∼ ?( , . 12) 通过随机采样? = 1 次,可以获得?个样本的训练数据集?train,代码如下: data = []# 保存样本集的列表 for i in range(100): # 循环采样 100 个点 x = np.random.uniform(-10., 10.) # 随机采样输入 random.normal(0., 0.01) # 得到模型的输出 y = 1.477 * x + 0.089 + eps data.append([x, y]) # 保存样本点 data = np.array(data) # 转换为 2D Numpy 数组 通过 for 循环进行 100 次采样,每次从均匀分布?(−1 ,1 )中随机采样一个数据?,同时从 均值为 1000 次,返回最优 w*,b*和训练 Loss 的下降过程 [b, w]= gradient_descent(data, initial_b, initial_w, lr, num_iterations) loss = mse(b, w, data) # 计算最优数值解 w,b 上的均方差 print(f'Final loss:{loss}, w:{w}, b:{b}')0 码力 | 439 页 | 29.91 MB | 1 年前3
PyTorch Brand GuidelinesPyTorch.org Please only use the PyTorch name and marks when accurately referencing the PyTorch Foundation or its software projects. When referring to our marks, please include the following attribution attribution statement: “PyTorch, the PyTorch logo and any related marks are trademarks of The Linux Foundation.” Find the full Trademark Policy at Linuxfoundation.org/trademark-usage/ 1 Brand Guidelines symbol allows us to speak through a more graphic language — without resorting to cliché fire or data metaphors. 2 Brand Guidelines PyTorch Symbol Clearspace While our system encourages a flexible0 码力 | 12 页 | 34.16 MB | 1 年前3
《Efficient Deep Learning Book》[EDL] Chapter 7 - Automationaspects of the training pipeline like data augmentation, layer and channel configurations can also be parameterized using hyperparameters. For example, when using image data augmentation with rotation, we can might also have additional parameters which could be searched as well. transformation parameters in data augmentation layer contribute to performance improvements while others like learning rate, batch layers.Dense(size, activation='relu'), layers.Dense(5, activation='softmax') ]) Our model, input data and the hyperparameter trial set is ready. Let's go ahead and train the model, each time choosing0 码力 | 33 页 | 2.48 MB | 1 年前3
机器学习课程-温州大学-12深度学习-自然语言处理和词嵌入略 41 ChatGPT得益于通用(基础)模型所构建 AI 系统的新范式 资料来源:《On the Opportunities and Risks of Foundation Models 》论文 ◼ 基础模型(Foundation Model)在广泛的应用中整合构建机器学习系统的方法,它为许多任务提供了强大的杠杆作用 ✓ 基础模型是在深度神经网络和自我监督学习的基础上演化而来。基础模型 的改进, 有证据表明,日志丢失与许多下游任务密切相关,随着规模的增长,日 志丢失呈现平稳的改善趋势。 资料来源:《On the Opportunities and Risks of Foundation Models 》论文 图:基础模型可以集中来自各种模态的所有数据的信息, 然后这一模型可以适用于广泛的下游任务 ChatGPT核心技术优势 43 参考文献 1. IAN GO0 码力 | 44 页 | 2.36 MB | 1 年前3
Experiment 6: K-Meansuse K-means to compress an image by reducing the number of colors it contains. To begin, download data6.zip and unpack its contents into your Matlab/Octave working directory. Photo credit: The bird photo this exercise belongs to Frank Wouters and is used with his permission. 2 Image Representation The data pack for this exercise contains a 538-pixel by 538-pixel TIFF image named bird large.tiff. It looks this image, each pixel is represented as three 8-bit numbers (ranging from 0 to 255) that specify red, green and blue intensity values. Our bird photo contains thousands of colors, but we’d like to reduce0 码力 | 3 页 | 605.46 KB | 1 年前3
Lecture Notes on Linear Regressionby ✓. Since our goal is to make predictions according to the hypothesis function given a new test data, we need to find the optimal value of ✓ such that the resulting prediction is as accurate as possible based on a given set of m training data {x(i), y(i)}i=1,··· ,m. In particular, we are supposed to find a hypothesis function (parameterized by ✓) which fits the training data as closely as possible. To measure measure the error between h✓ and the training data, we define a cost function (also called error function) J(✓) : Rn+1 ! R as follows J(✓) = 1 2 m X i=1 ⇣ h✓(x(i)) � y(i)⌘2 Our linear regression problem0 码力 | 6 页 | 455.98 KB | 1 年前3
Lecture 1: OverviewPeople’s Posts and Telecommunications Press, 2016 Trevor Hastie, The Elements of Statistical Learning: Data Mining, Inference, and Prediction (2nd Ed.), World Publishing Corporation, 2015 Christopher M. Bishop Personalized news or mail filter Personalized tutoring Discover new knowledge from large databases (data mining) Market basket analysis (e.g. diapers and beer) Medical information mining (e.g. migraines given only indirect feedback? Feng Li (SDU) Overview September 6, 2023 14 / 57 Source of Training Data Provided random examples outside of the learner’s control. Negative examples available or only positive0 码力 | 57 页 | 2.41 MB | 1 年前3
全连接神经网络实战. pytorch 版tensor 理解为是“data”。 我们需要先导入 pytorch,顺便导入 numpy: import torch import numpy as np 现在我们尝试将 list 或者 np.array 转换为 pytorch 的数组: data1 = [ [ 1 , 2 ] , [ 3 , 4 ] ] data_tensor = torch . tensor ( data1 ) print print ( data_tensor . shape ) np_array1 = np . array ( data1 ) data_tensor = torch . from_numpy( np_array1 ) print ( data_tensor . shape ) 输出都是: torch . Size ( [ 2 , 2 ] ) 对于二维 tensor 之间的相乘,@ 和 .matmul 7 y = data_tensor @ data_tensor .T print (y) y = data_tensor ∗ data_tensor print (y) 输出分别是: [ [ 5 , 11] , [11 , 2 5 ] ] [ [ 5 , 11] , [11 , 2 5 ] ] tensor 可以转化为 numpy: np_array2 = data_tensor0 码力 | 29 页 | 1.40 MB | 1 年前3
共 75 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8













