예제 #1
0
 def __init__(self, num_classes=61, mem_size=512, c_cam_classes=1000):
     super(attentionModel, self).__init__()
     self.num_classes = num_classes
     self.resNet = resNetNew.resnet34(True, True)
     self.mem_size = mem_size
     self.lsta_cell = MyConvLSTACell(512, mem_size, c_cam_classes)
     self.avgpool = nn.AvgPool2d(7)
     self.dropout = nn.Dropout(0.7)
     self.fc = nn.Linear(mem_size, self.num_classes)
     self.classifier = nn.Sequential(self.dropout, self.fc)
예제 #2
0
 def __init__(self, num_classes=61, mem_size=512, c_cam_classes=1000):
     super(attentionModelRepFlow, self).__init__()
     self.num_classes = num_classes
     self.resNet = resNetNew.resnet34(True, True)
     self.mem_size = mem_size
     self.weight_softmax = self.resNet.fc.weight
     self.flow_layer = FlowLayer(channels=128)
     self.lsta_cell = MyConvLSTACell(512, mem_size, c_cam_classes=c_cam_classes)
     self.avgpool = nn.AvgPool2d(7)
     self.dropout = nn.Dropout(0.7)
     self.fc = nn.Linear(mem_size, self.num_classes)
     self.classifier = nn.Sequential(self.dropout, self.fc)