def __call__(self, inputs):
x = inputs[0]
kernel_regularizer = kr.L1L2(l1=self.l1_decay, l2=self.l2_decay)
x = kl.Conv1D(128, 11,
name='conv1',
kernel_initializer=self.init,
kernel_regularizer=kernel_regularizer)(x)
x = kl.Activation('relu', name='act1')(x)
x = kl.MaxPooling1D(2, name='pool1')(x)
# 124
x = self._res_unit(x, [32, 32, 128], stage=1, block=1, stride=2)
x = self._res_unit(x, [32, 32, 128], atrous=2, stage=1, block=2)
x = self._res_unit(x, [32, 32, 128], atrous=4, stage=1, block=3)
# 64
x = self._res_unit(x, [64, 64, 256], stage=2, block=1, stride=2)
x = self._res_unit(x, [64, 64, 256], atrous=2, stage=2, block=2)
x = self._res_unit(x, [64, 64, 256], atrous=4, stage=2, block=3)
# 32
x = self._res_unit(x, [128, 128, 512], stage=3, block=1, stride=2)
x = self._res_unit(x, [128, 128, 512], atrous=2, stage=3, block=2)
x = self._res_unit(x, [128, 128, 512], atrous=4, stage=3, block=3)
# 16
x = self._res_unit(x, [256, 256, 1024], stage=4, block=1, stride=2)
x = kl.GlobalAveragePooling1D()(x)
x = kl.Dropout(self.dropout)(x)
return self._build(inputs, x)
评论列表
文章目录