Class Normalize(nn.Module):
def __init__(self, mean, std):
super(Normalize, self).__init__()
self.mean = torch.tensor(mean, device='cuda')
self.std = torch.tensor(std, device='cuda')
def forward(self, input):
x = input * 255
x = x - self.mean
x = x / self.std
return x
if onnx:
model = nn.Sequential(
Normalize([mean_r, mean_g, mean_b], [std_r, std_g, std_b]),
model
)
return model
'Deep Learning' 카테고리의 다른 글
A Holistic View of Perception in Intelligent Vehicles (0) | 2023.07.30 |
---|---|
[논문] Self-Distilled Self-supervised Representation Learning (0) | 2023.03.14 |
[논문] A survey on deep geometry learning: From a representation perspective (1) | 2022.10.08 |
[개념정리] 딥러닝 성능 용어정리 (0) | 2022.05.07 |
[개념정리] 딥러닝에서의 Inductive Bias (0) | 2022.05.05 |
댓글