【问题标题】:What is the advantage of not having pooling layers in between convolutions in this context?在这种情况下,在卷积之间没有池化层有什么好处?
【发布时间】:2016-12-29 18:12:08
【问题描述】:

在设计用于提取 DNA 基序的卷积神经网络的背景下,为什么要堆叠卷积层而没有最大池化函数?

这是该架构出现的上下文。

self.model = Sequential()
assert len(num_filters) == len(conv_width)
for i, (nb_filter, nb_col) in enumerate(zip(num_filters, conv_width)):
    conv_height = 4 if i == 0 else 1
    self.model.add(Convolution2D(
        nb_filter=nb_filter, nb_row=conv_height,
        nb_col=nb_col, activation='linear',
        init='he_normal', input_shape=self.input_shape,
        W_regularizer=l1(L1), b_regularizer=l1(L1)))
    self.model.add(Activation('relu'))
    self.model.add(Dropout(dropout))
self.model.add(MaxPooling2D(pool_size=(1, pool_width)))

【问题讨论】:

  • 如果您没有任何激活函数,则网络是多个线性函数的堆栈,因此是线性函数。这个网络不会很强大,因为它只能表示线性函数。为什么这样做,我不确定。
  • 有一层激活层,然后是一层最大池化,但都在卷积层之后。我的问题是为什么卷积层一个接一个地出现,而不是被激活层或池化层分开。 @PankajDaga
  • 在没有看到 soem 上下文或同伴的情况下不确定。通过这些层的信号只会被线性变换。 Why 正在完成这只是我的猜测,没有更多细节。
  • 请提供此类架构来源的链接。

标签: machine-learning deep-learning convolution conv-neural-network


【解决方案1】:

提供的代码确实在卷积之间使用激活

self.model = Sequential()
assert len(num_filters) == len(conv_width)
for i, (nb_filter, nb_col) in enumerate(zip(num_filters, conv_width)):
    conv_height = 4 if i == 0 else 1
    self.model.add(Convolution2D(
        nb_filter=nb_filter, nb_row=conv_height,
        nb_col=nb_col, activation='linear',
        init='he_normal', input_shape=self.input_shape,
        W_regularizer=l1(L1), b_regularizer=l1(L1)))
    self.model.add(Activation('relu')) #  <--------------------- ACTIVATION
    self.model.add(Dropout(dropout))
self.model.add(MaxPooling2D(pool_size=(1, pool_width)))

生成的模型类似于

conv -- relu -- dropout -- conv -- relu -- dropout -- ... -- max pool

为什么他们将激活分开而不是在 conv 本身中指定“激活”?不知道,看起来像一个奇怪的实施决定,但从实际的角度来看

self.model.add(Convolution2D(
        nb_filter=nb_filter, nb_row=conv_height,
        nb_col=nb_col, activation='linear',
        init='he_normal', input_shape=self.input_shape,
        W_regularizer=l1(L1), b_regularizer=l1(L1)))
self.model.add(Activation('relu'))

self.model.add(Convolution2D(
        nb_filter=nb_filter, nb_row=conv_height,
        nb_col=nb_col, activation='relu',
        init='he_normal', input_shape=self.input_shape,
        W_regularizer=l1(L1), b_regularizer=l1(L1)))

等效

【讨论】:

  • 你并不总是需要最大池化,每个这样的操作都会显着降低图像的分辨率,因此如果需要添加它,而不是默认添加乙>。就 FCN 层而言 - 它在那里,你显然没有详细阅读代码,请看第 130 行。
【解决方案2】:

对于给定的输入维度,您只能多次减少空间维度(通常每次减少 2 倍),然后才能达到无法再减少的 1x1 输出维度!因此,对于深度网络,您别无选择,只能使用不降维的层组(卷积),由进行降维的层分隔。因此,卷积层之间没有最大池化并没有任何优势,而是对于给定的输入大小,您只能拥有这么多总最大池化层。

请注意,这里使用的最大池化的唯一功能是降维——它没有其他好处。事实上,更现代的全卷积架构如 ResNet-50 并没有使用最大池化(输入端除外),而是使用 stride 2 卷积来逐渐降低维度。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-12
    • 2023-03-04
    • 2021-05-21
    相关资源
    最近更新 更多