【问题标题】:How to create Data layer in caffe?如何在 caffe 中创建数据层?
【发布时间】:2017-07-18 22:19:21
【问题描述】:

我有一个 Python 版本的 caffe 代码。 那个python代码有一个data layerlike

name: "hidden_seed"
type: "NumpyData"
top: "hidden_seed"

我喜欢在 c++ caffe 中装箱

layer{
    name: "hidden_seed"
    type: "Data"
    top: "hidden_seed"      
}

我的问题是如何创建一个大小为 300 x 250 且初始化为 0 值的数据层。

我查看了 caffe 中的数据层,可用的数据层是

Layers:

    Image Data - read raw images.
    Database - read data from LEVELDB or LMDB.
    HDF5 Input - read HDF5 data, allows data of arbitrary dimensions.
    HDF5 Output - write data as HDF5.
    Input - typically used for networks that are being deployed.
    Window Data - read window data file.
    Memory Data - read data directly from memory.
    Dummy Data - for static data and debugging.

哪一个适合我喜欢的Data层以及如何为每个单元格初始化0值?

【问题讨论】:

标签: python c++ neural-network deep-learning caffe


【解决方案1】:

似乎"DummyData" 层会为您完成这项工作:

layer {
  type: "DummyData"
  name: "hidden_seed"
  top: "hidden_seed"
  dummy_data_param {
    shape { dim: 300 dim: 250 }  # your desired data shape
    data_filler { type: "constant" value: 0 } # fill with all zeros
  }
}

【讨论】:

    猜你喜欢
    • 2018-01-20
    • 2015-07-31
    • 1970-01-01
    • 2016-07-15
    • 2017-08-13
    • 2017-10-15
    • 2014-07-31
    • 2018-01-09
    • 2016-02-20
    相关资源
    最近更新 更多