【问题标题】:What are the differences between aggregation and concatenation in convolutional neural networks?卷积神经网络中的聚合和连接有什么区别?
【发布时间】:2021-02-21 05:24:57
【问题描述】:

当我阅读一些关于 CNN 的经典论文时,例如 Inception family、ResNet、VGGnet 等,我注意到了术语concatenationsummationaggregation,这让我很困惑(总结对我来说很容易理解)。有人能告诉我它们之间有什么区别吗?也许以更具体的方式,例如使用示例来说明维度和表示能力的差异。

【问题讨论】:

  • 我投票结束这个问题,因为它不是关于 help center 中定义的编程,而是关于 ML 理论/方法。

标签: deep-learning conv-neural-network terminology


【解决方案1】:
  • 串联通常包括从不同的网络层获取 2 个或更多输出张量,并将它们沿通道维度串联
  • 聚合包括从不同的网络层获取 2 个或更多输出张量,并对它们应用选定的多元函数以聚合结果
  • 求和是聚合的一种特殊情况,其中函数是求和

这意味着我们通过聚合丢失了信息。另一方面,连接可以以更大的内存使用为代价来保留信息。

例如在 PyTorch 中:

import torch

batch_size = 8
num_channels = 3
h, w = 512, 512
t1 = torch.rand(batch_size, num_channels, h, w) # A tensor with shape [8, 3, 512, 512]
t2 = torch.rand(batch_size, num_channels, h, w) # A tensor with shape [8, 3, 512, 512]

torch.cat((t1, t2), dim=1) # A tensor with shape [8, 6, 512, 512]
t1 + t2 # A tensor with shape [8, 3, 512, 512]

【讨论】:

  • 很好的解释!!!谢谢你的回答,我想通了。
  • 随意提出我的回答解决的问题!谢谢!
猜你喜欢
  • 2017-11-14
  • 2019-05-06
  • 1970-01-01
  • 2020-10-19
  • 2017-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多