![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Pytorch
Sag_ittarius
认识你自己,凡事勿过度。
展开
-
CVPR2019-SPADE
1.encoderimport torch.nn as nnimport numpy as npimport torch.nn.functional as Ffrom models.networks.base_network import BaseNetworkfrom models.networks.normalization import get_nonspade_norm_la...原创 2020-04-24 17:01:30 · 620 阅读 · 0 评论 -
Mask RCNN
1.数据集的准备 # Train or evaluate if args.command == "train": # Training dataset. Use the training set and 35K from the # validation set, as as in the Mask RCNN paper. dat...原创 2020-04-24 16:55:53 · 163 阅读 · 0 评论 -
VS-ReID
参考网址:1.https://github.com/lxx1991/VS-ReID2.https://github.com/lmb-freiburg/flownet23.http://vision.middlebury.edu/flow/submit/4.https://blog.csdn.net/zouxy09/article/details/868385...原创 2020-04-24 16:55:31 · 175 阅读 · 0 评论 -
pytorch nn.Conv3d
input=torch.randn(20,16,10,50,100)#N,C,D,H,W1.m = nn.Conv3d(16, 33, 1, stride=1, padding=(3, 2, 1))output=m(input)output.size()torch.Size([20, 16, 10, 50, 100])结论:padding分别先从D,H,W分别对称增加维度,...原创 2019-04-15 16:53:09 · 2710 阅读 · 1 评论 -
backward-pytroch
input = Variable(data)# Get the featuresfeatures = feature_extractor(input)# Compute first loss and get the gradients for itloss1 = task1(features)loss1.backward(retain_graph=True)# This add t...转载 2018-12-11 20:02:54 · 152 阅读 · 0 评论 -
A total variation loss
import matplotlibimport torchx = torch.FloatTensor([1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3,3,3,1,1,1,1,1,0,0,1,1,1,1])#x = torch.FloatTensor([1,1,1,1,1,20,20,20,20,20,20,3,3,3,3,3,3,3,3,1,1,1,1,1,0,0,...原创 2018-12-11 19:58:30 · 1703 阅读 · 0 评论 -
张量操作
a = torch.randn(1,1,3,1)a.expand(2,1,3,1)a.expand(1,2,3,1)a.expand(1,1,6,1)#runtimerrora.expand(1,1,3,2)a.expand(1,1,3,1)#a.expand(1,1,3,1) == ab = torch.randn(1,1,2,2)b.repeat(1,1,1,1)#b.r...原创 2018-12-10 20:01:54 · 275 阅读 · 0 评论 -
F.cross_entropy-weight比较
import torchimport torch.nn.functional as Ffrom torch.autograd import Variablex = Variable(torch.Tensor([[1.0,2.0,3.0], [1.0,2.0,3.0]]))y = Variable(torch.LongTensor([1, 2]))w = torch.Tensor([1...原创 2018-12-07 16:22:25 · 3815 阅读 · 1 评论 -
pytorch0.4-window:BUG记录
1.RuntimeError: freeze_support()参考:https://github.com/pytorch/pytorch/issues/5858加上:if __name__ == '__main__':2.log_p = F.log_softmax(input, dim=1)pytorch的0.2版本不需要加维度,而>=0.3必须要加上维度3.UserWarning: in...原创 2018-05-10 22:28:45 · 399 阅读 · 0 评论 -
Generating Names with a Character-Level RNN
目录结构:1.准备数据2.创建网络3.训练3.1为训练做准备3.2训练网络3.3画loss损失率4.检验网络3.1为训练做准备EOS是3.2训练网络all_letters = string.ascii_letters + " .,;'-"n_letters = len(all_letters) + 1 # Plus EOS markercr翻译 2017-12-08 18:18:05 · 245 阅读 · 0 评论