
Pytorch
Sag_ittarius
认识你自己,凡事勿过度。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
CVPR2019-SPADE
1.encoder import torch.nn as nn import numpy as np import torch.nn.functional as F from models.networks.base_network import BaseNetwork from models.networks.normalization import get_nonspade_norm_la...原创 2020-04-24 17:01:30 · 736 阅读 · 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 · 214 阅读 · 0 评论 -
VS-ReID
参考网址: 1.https://github.com/lxx1991/VS-ReID 2.https://github.com/lmb-freiburg/flownet2 3.http://vision.middlebury.edu/flow/submit/ 4.https://blog.youkuaiyun.com/zouxy09/article/details/868385...原创 2020-04-24 16:55:31 · 225 阅读 · 0 评论 -
pytorch nn.Conv3d
input=torch.randn(20,16,10,50,100)#N,C,D,H,W 1. 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 · 2787 阅读 · 1 评论 -
backward-pytroch
input = Variable(data) # Get the features features = feature_extractor(input) # Compute first loss and get the gradients for it loss1 = task1(features) loss1.backward(retain_graph=True) # This add t...转载 2018-12-11 20:02:54 · 194 阅读 · 0 评论 -
A total variation loss
import matplotlib import torch x = 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 · 1793 阅读 · 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)#runtimerror a.expand(1,1,3,2) a.expand(1,1,3,1)#a.expand(1,1,3,1) == a b = torch.randn(1,1,2,2) b.repeat(1,1,1,1)#b.r...原创 2018-12-10 20:01:54 · 358 阅读 · 0 评论 -
F.cross_entropy-weight比较
import torch import torch.nn.functional as F from torch.autograd import Variable x = 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 · 3911 阅读 · 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 · 444 阅读 · 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 marker cr翻译 2017-12-08 18:18:05 · 283 阅读 · 0 评论