|
@@ -8,7 +8,7 @@ from chainer_addons.links.pooling import PoolingType
|
|
|
|
|
|
class InceptionHead(chainer.Chain):
|
|
class InceptionHead(chainer.Chain):
|
|
def __init__(self):
|
|
def __init__(self):
|
|
- super(InceptionHead, self).__init__()
|
|
|
|
|
|
+ super().__init__()
|
|
with self.init_scope():
|
|
with self.init_scope():
|
|
# input 3 x 299 x 299
|
|
# input 3 x 299 x 299
|
|
self.conv1 = Conv2D_BN(3, 32, ksize=3, stride=2)
|
|
self.conv1 = Conv2D_BN(3, 32, ksize=3, stride=2)
|
|
@@ -39,7 +39,7 @@ class InceptionHead(chainer.Chain):
|
|
|
|
|
|
class Inception1(chainer.Chain):
|
|
class Inception1(chainer.Chain):
|
|
def __init__(self, insize, sizes, outputs, **pool_args):
|
|
def __init__(self, insize, sizes, outputs, **pool_args):
|
|
- super(Inception1, self).__init__()
|
|
|
|
|
|
+ super().__init__()
|
|
|
|
|
|
out1x1, out5x5, out3x3, out_pool = outputs
|
|
out1x1, out5x5, out3x3, out_pool = outputs
|
|
s5x5, s3x3_1, s3x3_2 = sizes
|
|
s5x5, s3x3_1, s3x3_2 = sizes
|
|
@@ -67,7 +67,7 @@ class Inception1(chainer.Chain):
|
|
|
|
|
|
class Inception2(chainer.Chain):
|
|
class Inception2(chainer.Chain):
|
|
def __init__(self, insize, sizes, outputs, **pool_args):
|
|
def __init__(self, insize, sizes, outputs, **pool_args):
|
|
- super(Inception2, self).__init__()
|
|
|
|
|
|
+ super().__init__()
|
|
|
|
|
|
out1, out2 = outputs
|
|
out1, out2 = outputs
|
|
size1, size2 = sizes
|
|
size1, size2 = sizes
|
|
@@ -88,7 +88,7 @@ class Inception2(chainer.Chain):
|
|
|
|
|
|
class Inception3(chainer.Chain):
|
|
class Inception3(chainer.Chain):
|
|
def __init__(self, insize, sizes, outputs, **pool_args):
|
|
def __init__(self, insize, sizes, outputs, **pool_args):
|
|
- super(Inception3, self).__init__()
|
|
|
|
|
|
+ super().__init__()
|
|
|
|
|
|
out1x1, out7x7, out7x7x2, out_pool = outputs
|
|
out1x1, out7x7, out7x7x2, out_pool = outputs
|
|
s7x7_1, s7x7_2, s7x7x2_1, s7x7x2_2, s7x7x2_3, s7x7x2_4 = sizes
|
|
s7x7_1, s7x7_2, s7x7x2_1, s7x7x2_2, s7x7x2_3, s7x7x2_4 = sizes
|
|
@@ -120,7 +120,7 @@ class Inception3(chainer.Chain):
|
|
|
|
|
|
class Inception4(chainer.Chain):
|
|
class Inception4(chainer.Chain):
|
|
def __init__(self, insize, sizes, outputs, **pool_args):
|
|
def __init__(self, insize, sizes, outputs, **pool_args):
|
|
- super(Inception4, self).__init__()
|
|
|
|
|
|
+ super().__init__()
|
|
|
|
|
|
out3x3, out7x7 = outputs
|
|
out3x3, out7x7 = outputs
|
|
s3x3, s7x7_1, s7x7_2, s7x7_3 = sizes
|
|
s3x3, s7x7_1, s7x7_2, s7x7_3 = sizes
|
|
@@ -146,7 +146,7 @@ class Inception4(chainer.Chain):
|
|
|
|
|
|
class Inception5(chainer.Chain):
|
|
class Inception5(chainer.Chain):
|
|
def __init__(self, insize, sizes, outputs, **pool_args):
|
|
def __init__(self, insize, sizes, outputs, **pool_args):
|
|
- super(Inception5, self).__init__()
|
|
|
|
|
|
+ super().__init__()
|
|
|
|
|
|
out1x1, out3x3, out3x3x2, out_pool = outputs
|
|
out1x1, out3x3, out3x3x2, out_pool = outputs
|
|
s3x3, s3x3x2_1, s3x3x2_2 = sizes
|
|
s3x3, s3x3x2_1, s3x3x2_2 = sizes
|
|
@@ -186,7 +186,7 @@ class Inception5(chainer.Chain):
|
|
|
|
|
|
class AuxilaryClassifier(chainer.Chain):
|
|
class AuxilaryClassifier(chainer.Chain):
|
|
def __init__(self, n_classes):
|
|
def __init__(self, n_classes):
|
|
- super(AuxilaryClassifier, self).__init__()
|
|
|
|
|
|
+ super().__init__()
|
|
with self.init_scope():
|
|
with self.init_scope():
|
|
self.conv1 = Conv2D_BN(768, 128, ksize=1, pad=1)
|
|
self.conv1 = Conv2D_BN(768, 128, ksize=1, pad=1)
|
|
self.conv2 = Conv2D_BN(128, 768, ksize=7)
|
|
self.conv2 = Conv2D_BN(128, 768, ksize=7)
|