![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
pytorch
文章平均质量分 91
xiaolaoshuXD
这个作者很懒,什么都没留下…
展开
-
Pytorch笔记:卷积层的相关知识点
实验代码import torchimport torch.nn as nnimport torch.nn.functional as F#h/w = (h/w - kennel_size + 2padding) / stride + 1 卷积计算x = torch.randn(2, 3, 7, 6) # batch, channel , height , widthm = nn.Conv2d(3, 1, (3, 2), (2,1)) # in_channel, out_channel ,ke.原创 2020-09-18 18:55:01 · 260 阅读 · 0 评论 -
Pytorch笔记:风格迁移
Pytorch笔记:风格迁移训练模型:风格迁移网络+VGG16网络生成网络:风格迁移网络代码如下(根据陈云《深度学习框架:Pytorch入门与实践》的代码改动)main.pyimport torch as timport cv2 as cvimport torchvision as tvimport torchnet as tntfrom torch.utils import datafrom transformer_net import TransformerNetimport ut原创 2020-09-07 21:57:26 · 496 阅读 · 0 评论 -
Pytorch笔记:使用DCGAN生成人脸
Pytorch笔记:使用DCGAN生成人脸代码如下:train.pyimport argparseimport torchimport torchvisionimport torchvision.utils as vutilsimport torch.nn as nnfrom random import randintfrom model import NetD, NetGparser = argparse.ArgumentParser()parser.add_argument('-原创 2020-09-05 22:42:35 · 1250 阅读 · 2 评论 -
Pytorch笔记:自编码
import torchimport cv2 as cvimport torch.nn as nndef gettensor(s): scr = cv.imread(s) #print(scr.shape) c = torch.from_numpy(scr)/1.00 c=c.reshape(100*143*3) return c#print(gettensor().shape)def getimg(x,i): x=x.reshape(143,1原创 2020-08-31 23:08:01 · 207 阅读 · 0 评论 -
Pytorch笔记:RNN 循环神经网络 (回归)
Pytorch笔记:RNN 循环神经网络 (回归)import torchfrom torch import nnimport numpy as npimport matplotlib.pyplot as plt# torch.manual_seed(1) # reproducible# Hyper ParametersTIME_STEP = 10 # rnn time stepINPUT_SIZE = 1 # rnn input sizeLR = 0.02原创 2020-08-29 11:06:18 · 840 阅读 · 1 评论 -
Pytorch笔记:通过训练好的文件建立神经网络
Pytorch笔记:通过训练好的文件建立神经网络import torchimport numpy as npimport torch.nn.functional as Fx=torch.Tensor([[1,1],[1,0],[0,1],[0,0]])#训练数据y=torch.Tensor([[1],[0],[0],[1]])#标签#print(y)#搭建cnn的快速方法net=torch.nn.Sequential( torch.nn.Linear(2,10), torch原创 2020-08-27 20:41:30 · 135 阅读 · 0 评论 -
Pytorch笔记:通过快速搭建法建立深度神经网络cnn
Pytorch笔记:通过快速搭建法建立深度神经网络cnnimport torchimport numpy as npimport torch.nn.functional as Fx=torch.Tensor([[1,1],[1,0],[0,1],[0,0]])#训练数据y=torch.Tensor([[1],[0],[0],[1]])#标签#print(y)#搭建cnn的快速方法net=torch.nn.Sequential( torch.nn.Linear(2,10), t原创 2020-08-27 20:19:43 · 350 阅读 · 0 评论 -
Pytorch笔记:建立深度神经网络cnn
Pytorch笔记建立深度神经网络cnnimport torchimport numpy as npimport torch.nn.functional as Fx=torch.Tensor([[1,1],[1,0],[0,1],[0,0]])#训练数据y=torch.Tensor([[1],[0],[0],[1]])#标签#print(y)class network(torch.nn.Module): def __init__(self,in_num,hidden_num,out_原创 2020-08-27 19:59:44 · 434 阅读 · 0 评论