Caffe,在图层中设置自定义权重

Caffe, setting custom weights in layer

我有网络。在一个地方我想使用 concat。就像这张图一样。

遗憾的是,网络无法训练。理解为什么我想在 concat 中改变权重。这意味着开始时,来自 FC4096 的所有值都将变为 1,而来自 FC16000 的所有值将变为 0。

我知道 FC4096 可以获得 57% 的准确率,所以学习率 10^-6 我会明白为什么在连接层之后没有学习。

问题是,如何将 FC4096 的所有值设置为 1,将 FC16000 的所有值设置为 0?

您可以在 FC16000 之上添加一个 "Scale" 层并将其初始化为 0:

layer {
  name: "scale16000"
  type: "Scale"
  bottom: "fc16000"
  top: "fc16000"  # not 100% sure this layer can work in-place, worth trying though.
  scale_param {
    bias_term: false
    filler: { type: "constant" value: 0 }
  }
  param { lr_mult: 0 decay_mult: 0 } # set mult to non zero if you want to train this scale
}