提交 f30a4a1b 编写于 作者: L lvmengsi

Merge branch 'fix_mobilenetv2' into 'develop'

Fix mobilenetv2

See merge request !84
...@@ -60,7 +60,6 @@ class MobileNetV2Space(SearchSpaceBase): ...@@ -60,7 +60,6 @@ class MobileNetV2Space(SearchSpaceBase):
# original MobileNetV2 # original MobileNetV2
# yapf: disable # yapf: disable
init_token_base = [4, # 1, 16, 1 init_token_base = [4, # 1, 16, 1
4, 5, 1, 0, # 6, 24, 1
4, 5, 1, 0, # 6, 24, 2 4, 5, 1, 0, # 6, 24, 2
4, 4, 2, 0, # 6, 32, 3 4, 4, 2, 0, # 6, 32, 3
4, 4, 3, 0, # 6, 64, 4 4, 4, 3, 0, # 6, 64, 4
...@@ -75,10 +74,9 @@ class MobileNetV2Space(SearchSpaceBase): ...@@ -75,10 +74,9 @@ class MobileNetV2Space(SearchSpaceBase):
""" """
Get range table of current search space, constrains the range of tokens. Get range table of current search space, constrains the range of tokens.
""" """
# head_num + 7 * [multiple(expansion_factor), filter_num, repeat, kernel_size] # head_num + 6 * [multiple(expansion_factor), filter_num, repeat, kernel_size]
# yapf: disable # yapf: disable
range_table_base = [len(self.head_num), range_table_base = [len(self.head_num),
len(self.multiply), len(self.filter_num1), len(self.repeat), len(self.k_size),
len(self.multiply), len(self.filter_num1), len(self.repeat), len(self.k_size), len(self.multiply), len(self.filter_num1), len(self.repeat), len(self.k_size),
len(self.multiply), len(self.filter_num2), len(self.repeat), len(self.k_size), len(self.multiply), len(self.filter_num2), len(self.repeat), len(self.k_size),
len(self.multiply), len(self.filter_num3), len(self.repeat), len(self.k_size), len(self.multiply), len(self.filter_num3), len(self.repeat), len(self.k_size),
...@@ -103,23 +101,20 @@ class MobileNetV2Space(SearchSpaceBase): ...@@ -103,23 +101,20 @@ class MobileNetV2Space(SearchSpaceBase):
(self.multiply[tokens[1]], self.filter_num1[tokens[2]], (self.multiply[tokens[1]], self.filter_num1[tokens[2]],
self.repeat[tokens[3]], 2, self.k_size[tokens[4]])) self.repeat[tokens[3]], 2, self.k_size[tokens[4]]))
self.bottleneck_params_list.append( self.bottleneck_params_list.append(
(self.multiply[tokens[5]], self.filter_num1[tokens[6]], (self.multiply[tokens[5]], self.filter_num2[tokens[6]],
self.repeat[tokens[7]], 2, self.k_size[tokens[8]])) self.repeat[tokens[7]], 2, self.k_size[tokens[8]]))
self.bottleneck_params_list.append( self.bottleneck_params_list.append(
(self.multiply[tokens[9]], self.filter_num2[tokens[10]], (self.multiply[tokens[9]], self.filter_num3[tokens[10]],
self.repeat[tokens[11]], 2, self.k_size[tokens[12]])) self.repeat[tokens[11]], 2, self.k_size[tokens[12]]))
self.bottleneck_params_list.append( self.bottleneck_params_list.append(
(self.multiply[tokens[13]], self.filter_num3[tokens[14]], (self.multiply[tokens[13]], self.filter_num4[tokens[14]],
self.repeat[tokens[15]], 2, self.k_size[tokens[16]])) self.repeat[tokens[15]], 1, self.k_size[tokens[16]]))
self.bottleneck_params_list.append(
(self.multiply[tokens[17]], self.filter_num4[tokens[18]],
self.repeat[tokens[19]], 1, self.k_size[tokens[20]]))
self.bottleneck_params_list.append( self.bottleneck_params_list.append(
(self.multiply[tokens[21]], self.filter_num5[tokens[22]], (self.multiply[tokens[17]], self.filter_num5[tokens[18]],
self.repeat[tokens[23]], 2, self.k_size[tokens[24]])) self.repeat[tokens[19]], 2, self.k_size[tokens[20]]))
self.bottleneck_params_list.append( self.bottleneck_params_list.append(
(self.multiply[tokens[25]], self.filter_num6[tokens[26]], (self.multiply[tokens[21]], self.filter_num6[tokens[22]],
self.repeat[tokens[27]], 1, self.k_size[tokens[28]])) self.repeat[tokens[23]], 1, self.k_size[tokens[24]]))
def _modify_bottle_params(output_stride=None): def _modify_bottle_params(output_stride=None):
if output_stride is not None and output_stride % 2 != 0: if output_stride is not None and output_stride % 2 != 0:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册