Skip to content

Commit

Permalink
Merge pull request NoamRosenberg#16 from zhizhangxian/test2
Browse files Browse the repository at this point in the history
all FxBx(s/4)
  • Loading branch information
HankKung authored Aug 27, 2019
2 parents 1168f82 + 43dfab9 commit aca71fa
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
13 changes: 7 additions & 6 deletions auto_deeplab.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ def __init__(self, num_classes, num_layers, criterion = None, filter_multiplier
self._filter_multiplier = filter_multiplier
self._criterion = criterion
self._initialize_alphas_betas ()
C_initial = self._filter_multiplier * self._block_multiplier
# C_initial = self._filter_multiplier * self._block_multiplier
C_initial = 128
half_C_initial = int(C_initial / 2)

self.stem0 = nn.Sequential(
Expand All @@ -39,7 +40,7 @@ def __init__(self, num_classes, num_layers, criterion = None, filter_multiplier
)


intitial_fm = C_initial / self._block_multiplier
intitial_fm = C_initial
for i in range (self._num_layers) :


Expand Down Expand Up @@ -139,16 +140,16 @@ def __init__(self, num_classes, num_layers, criterion = None, filter_multiplier
self.cells += [cell4]

self.aspp_4 = nn.Sequential (
ASPP (self._block_multiplier * self._filter_multiplier, self._num_classes, 24, 24) #96 / 4 as in the paper
ASPP (self._filter_multiplier, self._num_classes, 24, 24) #96 / 4 as in the paper
)
self.aspp_8 = nn.Sequential (
ASPP (self._block_multiplier * self._filter_multiplier * 2, self._num_classes, 12, 12) #96 / 8
ASPP (self._filter_multiplier * 2, self._num_classes, 12, 12) #96 / 8
)
self.aspp_16 = nn.Sequential (
ASPP (self._block_multiplier * self._filter_multiplier * 4, self._num_classes, 6, 6) #96 / 16
ASPP (self._filter_multiplier * 4, self._num_classes, 6, 6) #96 / 16
)
self.aspp_32 = nn.Sequential (
ASPP (self._block_multiplier * self._filter_multiplier * 8, self._num_classes, 3, 3) #96 / 32
ASPP (self._filter_multiplier * 8, self._num_classes, 3, 3) #96 / 32
)


Expand Down
18 changes: 12 additions & 6 deletions cell_level_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,23 @@ def __init__(self, steps, block_multiplier, prev_prev_fmultiplier,
filter_multiplier):

super(Cell, self).__init__()
self.C_in = block_multiplier * filter_multiplier * block_multiplier
self.C_out = filter_multiplier * block_multiplier
self.C_prev_prev = int(prev_prev_fmultiplier * block_multiplier)
# self.C_in = block_multiplier * filter_multiplier * block_multiplier
# self.C_out = filter_multiplier * block_multiplier
self.C_in = block_multiplier * filter_multiplier
self.C_out = filter_multiplier
# self.C_prev_prev = int(prev_prev_fmultiplier * block_multiplier)
self.C_prev_prev = int(prev_prev_fmultiplier)
if prev_fmultiplier_down is not None:
self.C_prev_down = int(prev_fmultiplier_down * block_multiplier)
# self.C_prev_down = int(prev_fmultiplier_down * block_multiplier)
self.C_prev_down = prev_fmultiplier_down
self.preprocess_down = FactorizedReduce(self.C_prev_down, self.C_out, affine=False)
if prev_fmultiplier_same is not None:
self.C_prev_same = int(prev_fmultiplier_same * block_multiplier)
# self.C_prev_same = int(prev_fmultiplier_same * block_multiplier)
self.C_prev_same = prev_fmultiplier_same
self.preprocess_same = ReLUConvBN(self.C_prev_same, self.C_out, 1, 1, 0, affine=False)
if prev_fmultiplier_up is not None:
self.C_prev_up = int(prev_fmultiplier_up * block_multiplier)
# self.C_prev_up = int(prev_fmultiplier_up * block_multiplier)
self.C_prev_up = prev_fmultiplier_up
self.preprocess_up = FactorizedIncrease(self.C_prev_up, self.C_out)


Expand Down

0 comments on commit aca71fa

Please sign in to comment.