上一页 1 ··· 7 8 9 10 11 12 13 14 下一页
摘要: 看了一篇博客,感觉写的很棒:PyTorch 的 Autograd 阅读全文
posted @ 2020-06-28 17:52 九叶草 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 运行这段代码 import torch import numpy as np import matplotlib.pyplot as plt x = torch.ones(2,2,requires_grad=True) print('x:\n',x) y = torch.eye(2,2,requir 阅读全文
posted @ 2020-06-28 09:02 九叶草 阅读(21961) 评论(0) 推荐(0) 编辑
摘要: output = torch.max(input, dim) input输入的是一个tensor dim是max函数索引的维度0/1,0是每列的最大值,1是每行的最大值 实例: import torch import numpy as np import matplotlib.pyplot as p 阅读全文
posted @ 2020-06-27 19:49 九叶草 阅读(5007) 评论(0) 推荐(0) 编辑
摘要: 本篇借鉴了这篇文章,如果有兴趣,大家可以看看:https://blog.csdn.net/geter_CS/article/details/84857220 1、交叉熵:交叉熵主要是用来判定实际的输出与期望的输出的接近程度 2、CrossEntropyLoss()损失函数结合了nn.LogSoftm 阅读全文
posted @ 2020-06-26 13:47 九叶草 阅读(16971) 评论(0) 推荐(0) 编辑
摘要: 看pytorch中文文档摘抄的笔记。 class torch.optim.SGD(params, lr=, momentum=0, dampening=0, weight_decay=0, nesterov=False)[source] 实现随机梯度下降算法(momentum可选)。 Nestero 阅读全文
posted @ 2020-06-26 11:53 九叶草 阅读(42241) 评论(0) 推荐(3) 编辑
摘要: import torch x = torch.randn(3, requires_grad=True) y = x*2 print(y.data.norm()) print(torch.sqrt(torch.sum(torch.pow(y,2)))) #其实就是对y张量L2范数,先对y中每一项取平方 阅读全文
posted @ 2020-06-25 17:20 九叶草 阅读(5972) 评论(0) 推荐(0) 编辑
摘要: 学习数据酷客做的笔记,懒得自己打字,就截屏记录一下,方便以后回顾。 阅读全文
posted @ 2020-06-24 19:30 九叶草 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-06-24 19:23 九叶草 阅读(297) 评论(0) 推荐(0) 编辑
摘要: 第一步安装nibabel,可以使用命令:pip install nibabel 之后: from nibabel.viewers import OrthoSlicer3D as osdimport nibabel as nib filename = 'image.nii' img = nib.loa 阅读全文
posted @ 2020-06-24 08:46 九叶草 阅读(6860) 评论(1) 推荐(0) 编辑
摘要: 1、LinearRegression将方程分为两个部分存放,coef_存放回归系数,intercept_则存放截距,因此要查看方程,就是查看这两个变量的取值。 2、回归系数(regression coefficient)在回归方程中表示自变量x 对因变量y 影响大小的参数。回归系数越大表示x 对y 阅读全文
posted @ 2020-06-22 15:08 九叶草 阅读(547) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 下一页