原创 pytorch方法測試——歸一化(BatchNorm2d)

測試代碼:import torchimport torch.nn as nn m = nn.BatchNorm2d(2,affine=True) #權重w和偏重將被使用 input = torch.randn(1,2,3,4) outp

原创 pytorch方法測試——激活函數(ReLU)

測試代碼: import torch import torch.nn as nn #inplace爲True,將會改變輸入的數據 ,否則不會改變原輸入,只會產生新的輸出 m = nn.ReLU(inplace=True) input =

原创 pytorch方法測試——損失函數(BCELoss)

測試代碼:import torch import torch.nn as nn import math m = nn.Sigmoid() loss = nn.BCELoss(size_average=False, reduce=Fal

原创 pytorch方法測試——卷積(二維)

測試代碼:import torch import torch.nn as nnm = nn.Conv2d(2, 2, 3, stride=2) input = torch.randn(1, 2, 5, 7) output = m(inpu

原创 pytorch方法測試——損失函數(CrossEntropyLoss)

測試代碼:import torch import torch.nn as nn import math loss = nn.CrossEntropyLoss() input = torch.randn(1, 5, requires_gra

原创 解決win下vs+yolov3使用Dll載入圖片和載入Mat檢測出來效果不一致的問題。

問題描述:    在windows下使用vs2015 + Yolov3的DLL版本時(https://github.com/AlexeyAB/darknet),根據官網有兩種檢測方法如下圖:一種是直接加載圖片的文件名,另一種是使用Open

原创 pytorch方法測試——卷積(三維)

測試代碼:import torch import torch.nn as nn import torch.autograd as autograd m = nn.Conv3d(2, 1, 3, stride=2) input = aut

原创 pytorch方法測試——卷積(一維)

import torch import torch.nn as nn m = nn.Conv1d(2, 5, 2, stride=2) print(m) input = torch.randn(2,2, 5) print(input)