Skip to content

Commit

Permalink
(2+4+15+2)*3 + 3 + 3 + 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Junhong Xu committed Jun 7, 2017
1 parent 2964a95 commit c417d47
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions planet_models/fpn.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ def __init__(self, block, layers, input_channels=3, num_classes=17):
self.f3 = nn.Sequential(_make_conv_bn_elu(1024, 256)) # 4*4*256

# reduce dimensionality before classifier 1*1*256
self.maxpool1 = nn.AdaptiveMaxPool2d(1)
self.maxpool2 = nn.AdaptiveMaxPool2d(1)
self.maxpool3 = nn.AdaptiveMaxPool2d(1)
self.pool1 = nn.AdaptiveAvgPool2d(1)
self.pool2 = nn.AdaptiveAvgPool2d(1)
self.pool3 = nn.AdaptiveAvgPool2d(1)

# clasifier
self.cls_1 = nn.Sequential(_make_linear_bn_elu(256, 512))
Expand Down Expand Up @@ -158,11 +158,11 @@ def forward(self, x):
f3 = self.f3(m3) # 2*2*256

# max pool
f1 = self.maxpool1(f1) # 256
f1 = self.pool1(f1) # 256
f1 = f1.view(f1.size(0), -1)
f2 = self.maxpool2(f2) # 256
f2 = self.pool2(f2) # 256
f2 = f2.view(f2.size(0), -1)
f3 = self.maxpool3(f3) # 256
f3 = self.pool3(f3) # 256
f3 = f3.view(f3.size(0), -1)
# classifier
cls1 = self.cls_1(f1)
Expand Down
2 changes: 1 addition & 1 deletion trainers/train_pynet.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def get_optimizer(model, pretrained=True, lr=5e-5, weight_decay=5e-5):

def train(epoch):
criterion = MultiLabelSoftMarginLoss()
net = FPNet(Bottleneck, [2, 3, 3, 2])
net = FPNet(Bottleneck, [2, 4, 15, 2])
logger = Logger('../log/', NAME)
optimizer = get_optimizer(net, False, 1e-4, 5e-4)
net.cuda()
Expand Down

0 comments on commit c417d47

Please sign in to comment.