Some thoughts and gain
CrossEntropyLoss: Replace self defined CrossEntropyLoss with nn.CrossEntropyLoss improves the accuracy from 1.0 to 0.256 or more.
- Analysis: nn.CrossEntropyLoss use mean as default to aggreate loss value in a batch.
高斯卷积
import cv2
g = cv2.GaussianBlur(image, ksize = (3, 3), sigmaX = 1)
import cv2
kernel_1d = cv2.getGaussianKernel(ksize=3, sigma=1)
kernel_2d = kernel_1d * kernel_1d.T
g = cv2.filter2D(image, -1, kernel_2d)
import cv2
kernel_1d = cv2.getGaussianKernel(ksize=3, sigma=1)
g = cv2.sepFilter2D(a, -1, kernel_1d, kernel_1d)