![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
pytorch
嘀嗒嘀嘀嗒嘀
这个作者很懒,什么都没留下…
展开
-
【pytorch】批处理
import torch import torch.utils.data as Data BATCH_SZIE = 3 x = torch.linspace(1,10,10) y = torch.linspace(10,1,10) # print(x) # tensor 类型,可以直接转为numpy torch_dataset = Data.TensorDataset(x, y) loade...转载 2018-06-11 16:17:20 · 962 阅读 · 0 评论 -
【pytorch】回归拟合
import torch from torch.autograd import Variable import torch.nn.functional as F import matplotlib.pyplot as plt x = torch.unsqueeze(torch.linspace(-1,1,100),dim = 1) #压缩为2维,因为torch 中 只会处理二维的数据 # pri...转载 2018-06-10 17:09:51 · 833 阅读 · 0 评论 -
【pytorch】激励函数
import torch from torch.autograd import Variable import matplotlib.pyplot as plt import torch.nn.functional as F # 做一些假数据来观看图像 x = torch.linspace(-5, 5, 200) # x data (tensor), shape=(100, 1) x = Va...转载 2018-06-10 16:36:34 · 527 阅读 · 0 评论 -
【pytorch】variable 和 tensor
import torch from torch.autograd import Variable tensor = torch.FloatTensor([[1,2],[3,4]]) variable = Variable(tensor,requires_grad=True) print(tensor) print(variable) t_out = torch.mean(tensor * t...原创 2018-06-10 15:26:06 · 850 阅读 · 0 评论 -
【pytorch】CNN卷积神经网络
import os # third-party library import torch import torch.nn as nn import torch.utils.data as Data import torchvision import matplotlib.pyplot as plt # torch.manual_seed(1) # reproducible # Hyp...转载 2018-06-11 22:57:32 · 315 阅读 · 0 评论 -
【pytorch】优化器
摘自here 优化器的参数有待进一步了解 import torch from torch.autograd import Variable import torch.nn.functional as F import matplotlib.pyplot as plt import torch.utils.data as Data # super param LR = 0.01 BATCH_S...转载 2018-06-11 19:06:03 · 1294 阅读 · 0 评论 -
【调参之损失函数】train loss 和 test loss 一直不下降
正常情况: train loss 不断下降,test loss不断下降,说明网络仍在学习; 异常情况: train loss 不断下降,test loss趋于不变,说明网络过拟合; train loss 趋于不变,test loss不断下降,说明数据集100%有问题; train loss 趋于不变,test loss趋于不变,说明学习遇到瓶颈,需要减小学习率或批量数目; train ...转载 2018-11-08 18:42:26 · 10107 阅读 · 3 评论