machine-learning - Caffe,在层中设置自定义权重

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

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

不幸的是,网络无法训练。为了理解为什么我想连续改变权重。这意味着 FC4096 中的所有值一开始都将变为 1,而 FC16000 中的所有值都将变为 0。

我知道 FC4096 的准确度为 57%,因此学习率为 10^-6 时我就会明白为什么在串联层之后没有学习。

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

最佳答案

您可以添加 "Scale"层位于 FC16000 之上并将其初始化为 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
}

关于machine-learning - Caffe,在层中设置自定义权重,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44761118/

相关文章:

python - Tensorflow:如何在一个模块中拥有 saver.save() 和 .restore() ?

python - 带管道的岭回归网格搜索

python - keras load_model 第二次执行时引发错误

python-3.x - 使用keras进行多类别图像分类

image-processing - 什么是计算机视觉中的各向异性缩放?

python - 神经网络在一个时代后变平

machine-learning - PyTorch 中的后向函数

machine-learning - 无效参数错误 : You must feed a value for placeholder tensor 'Placeholder' with dtype float and shape [1000, 625]

computer-vision - Fast-RCNN 最终边界框

python - Tensorflow Session.Run() 张量对象不可调用