- 博客(7)
- 收藏
- 关注
原创 2021-01-20
PyTorch学习笔记(七)卷积神经网络-LeNet-5import torchimport numpy as npimport torch.nn as nnimport torch.optim as optimfrom torch.autograd import Variablefrom torch.utils.data import DataLoaderfrom torchvision import datasets, transforms#下载训练集train_dataset =
2021-01-20 21:19:28 56
原创 2021-01-20
PyTorch学习笔记(六)MNIST手写数字识别(三)防止过拟合的方法:1.Dropoutimport torchimport numpy as npimport torch.nn as nnimport torch.optim as optimfrom torch.autograd import Variablefrom torch.utils.data import DataLoaderfrom torchvision import datasets, transforms#下
2021-01-20 21:15:52 62
原创 2021-01-19
PyTorch学习笔记(五)MNIST手写数字识别(二)使用交叉熵代价函数完整代码:import torchimport numpy as npimport torch.nn as nnimport torch.optim as optimfrom torch.autograd import Variablefrom torch.utils.data import DataLoaderfrom torchvision import datasets, transforms#下载训练集
2021-01-19 23:09:37 60
原创 2021-01-19
PyTorch学习笔记(四 )MNIST手写数字识别(一)简单程序完整代码:import torchimport numpy as npimport torch.nn as nnimport torch.optim as optimfrom torch.autograd import Variablefrom torch.utils.data import DataLoaderfrom torchvision import datasets, transforms#下载训练集trai
2021-01-19 23:06:30 60
原创 2021-01-19
PyTorch学习笔记(三)非线性回归(non-LinearRegression)非线性回归模型与线性回归基本相同,区别在于:线性就是每个变量的指数都是1,而非线性就是至少有一个变量的指数不是1。完整代码:import torchimport numpy as npimport torch.nn as nnimport torch.optim as optimimport matplotlib.pyplot as pltfrom torch.autograd import Variable
2021-01-19 16:55:20 68
原创 2021-01-19
线性回归(LinearRegression)一. 导入基本模块import numpy as npimport matplotlib.pyplot as pltimport torchimport torch.nn as nnimport torch.optim as optimfrom torch.autograd import Variable二. 生成数据生成数据x_data = np.random.rand(100) # 生成随机数据noise = np.random.nor
2021-01-19 12:01:44 102 1
原创 2021-01-18
PyTorch学习笔记一.tensor属性及基本运算1.tensors(张量)tensors类似于Numpy的ndarrys,同时tensors可以使用GPU进行计算。from __future__ import print_function #必须放在最开头import torchx = torch.empty(5,3) #生成空的矩阵print(x)out:tensor([[ 0.0000e+00, 0.0000e+00, 0.0000e+00], [ 0.000
2021-01-18 23:12:12 161
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人