【问题标题】:Caffe, setting custom weights in layerCaffe,在图层中设置自定义权重
【发布时间】:2017-11-29 09:01:50
【问题描述】:

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

不幸的是,网络没有训练。要了解我为什么要更改 concat 中的权重。这意味着来自 FC4096 的所有值都将得到 1,而来自 FC16000 的所有值将在开始时得到 0。

我知道 FC4096 会给我 57% 的准确率,所以在学习率为 10^-6 的情况下,我会理解为什么在连接层之后没有学习。

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

【问题讨论】:

  • 按权重,你的意思是说,来自 FC16000 的每个值都会 1,还是设置 为1?
  • @GoodDeeds 抱歉,我不清楚。我的意思是将权重设置为 1 或 0。Shai 的回答解决了我的问题。

标签: machine-learning neural-network deep-learning caffe pycaffe


【解决方案1】:

您可以在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
}

【讨论】:

    猜你喜欢
    • 2016-02-20
    • 2017-07-25
    • 1970-01-01
    • 2017-04-30
    • 2017-11-24
    • 2021-06-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多