컴퓨터비전
-
[Pytorch]ResNet(전차학습모델)컴퓨터비전/pytorch 2023. 1. 13. 23:09
CNN은 레이어가깊어지면 기울기 소실이 쉽게 일어난다 그래서 전에있던값을 재탕함으로써 기울기를 살리는 기법 Block부분 class BasicBlock(nn.Module): def __init__(self,input_dim,output_dim, stride = 1): super(BasicBlock,self).__init__() self.conv1=nn.Conv2d(input_dim,output_dim,3,1,1) self.conv2=nn.Conv2d(output_dim,output_dim,3,1,1) self.bn1=nn.BatchNorm2d(output_dim) self.bn2=nn.BatchNorm2d(output_dim) self.relu1=nn.ReLU() self.relu2=nn.ReLU() s..