- 博客(14)
- 资源 (4)
- 收藏
- 关注
原创 Python:itertools.product详解
Itertools.productproduct(a,b): 返回两个集合a,b中元素的笛卡尔乘积。笛卡尔乘积:A={a,b}, B={0,1,2}A×B = {(a, 0), (a, 1), (a, 2), (b, 0), (b, 1), (b, 2)}B×A = {(0, a), (0, b), (1, a), (1, b), (2, a), (2, b)}由此可以看到可用在循环的嵌套当中product(*args):接收若干个位置参数,转换成元组tuple形式示例
2020-10-10 17:18:31 7915 1
原创 CIFAR10数据集使用笔记
CIFAR10数据集1. 数据集下载并转换为张量train_set = torchvision.datasets.CIFAR10(root=data_path, train=True, download=True, transform=transforms.Compose([ transforms.ToTensor()
2020-10-08 15:25:24 1999 1
原创 (4)学习机制---Training, validation, and overfitting
The mechanics of learningNo.4 Training, validation, and overfittingOn one hand, you need to model to have enough capacity for it to fit the training set. On the other hand, you need the model to avoid overfitting. Therefore, the process for choosing the
2020-10-04 16:06:12 248 1
原创 (3)学习机制---Optimizers a la carte, Nits in autograd and switching it off
The mechanics of learningNo.3 Optimizers a la carteEvery optimizer constructor takes a list of parameters (aka PyTorch tensors, typically with requires_grad set to True) as the first input. All parameters passed to the optimizer are retained inside the o
2020-10-04 12:00:21 154
原创 (2)学习机制---PyTorch’s autograd: Backpropagate all things
The mechanics of learningNo.2 PyTorch’s autograd: Backpropagate all thingsPyTorch tensors can remember where they come from in terms of the operations and parent tensors that originated them, and they can provide the chain of derivatives of such operatio
2020-10-03 16:42:40 137
原创 (1) 学习机制---Learning is parameter estimation
The mechanics of learningNO.1 Learning is parameter estimationA hot problemimport torcht_c = [0.5, 14.0, 15.0, 28.0, 11.0, 8.0, 3.0, -4.0, 6.0, 13.0, 21.0]t_u = [35.7, 55.9, 58.2, 81.9, 56.3, 48.9, 33.9, 21.8, 48.4, 60.4, 68.4]t_c = torch.tensor(t
2020-09-30 16:25:10 161
原创 (3) 用张量表示实际数据---Images
Real-world data representation with tensorsNO. 3 ImagesFollowing the same strategy that you used for earlier data types, to create a data set of multiple images to use as an input for your neural networks, you store the images in a batch along the first
2020-09-28 16:19:54 204
原创 (2) 用张量表示实际数据---Time series
Real-world data representation with tensorsNO. 2 Time seriesIn the meantime, we’ll switch to another interesting data set: data from a Washington, D.C., bike sharing system reporting the hourly count of rental bikes between 2011 and 2012 in the Capital
2020-09-27 19:48:27 287
原创 (1) 用张量表示实际数据---Tabular data
Real-world data representation with tensorsNO. 1 Tabular dataPython offers several options for loading a CSV file quickly.Start with the Wine Quality data set: csvLoad your file and turn the resulting NumPy array into a PyTorch tensor.import csvim
2020-09-27 11:58:37 1375
原创 (4) 张量
It starts with a tensorNO.6 Numeric typesThe data type specifies the possible values that the tensor can hold (integers versus floating-point numbers) and the number of bytes per value???? torch.float32 or torch.float—32-bit floating-point???? torch
2020-09-26 11:13:54 135
原创 (3)张量
It starts with a tensorNO.4 Size, storage offset, and stridesTo index into a storage, tensors rely on a few pieces of information that, together with their storage, unequivocally define them: size, storage offset, and stride.The storage offset is the
2020-09-23 17:12:09 141
原创 (2) 张量
It starts with a tensorNO.3 Tensors and storagesValues are allocated in contiguous chunks of memory, managed by <torch.Storage> instances.A PyTorch Tensor is a view over such a Storage that’s capable of indexing into that storage by using an offs
2020-09-23 11:28:07 105
原创 (1) 张量
It starts with a tensorNO.1 PrefaceThe first step of this process is converting the input into floating-point numbers.PyTorch introduces a fundamental data structure: the tensor.NO.2 Tensor fundamentalsA tensor is an array—that is, a data structu
2020-09-23 10:59:14 126
原创 Pytorch的可视化:visdom(一)
visdom的初级使用1. 测试代码引用import visdom # 添加visdom库import numpy as np # 添加numpy库vis = visdom.Visdom(env='test') # 设置环境窗口的名称,如果不设置名称就默认为mainvis.text('test', win='main') # 使用文本输出vis.image(np.ones((...
2020-02-06 17:58:47 2403
bike-sharing-dataset.zip
2020-09-27
static.zip
2020-02-06
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人