1. 程式人生 > >caffe 中新增新的 layer 和相應測試的過程

caffe 中新增新的 layer 和相應測試的過程

新增新 layer

新增一個簡單的 layer 可以參考 https://github.com/BVLC/caffe/wiki/Simple-Example:-Sin-Layer
幾個主要的過程如下:

  1. 新增 include/caffe/layers/your_layer.hpp
  2. 新增 src/caffe/layers/your_layer.cpp
  3. 新增 test/test_your_layer.cpp
  4. 回到 build 資料夾 cmake -DCPU_ONLY=1 .. && make -j 4 && make test && make runtest && test/test.testbin --gtest_filter='*YouTestrClassName*'

參考

https://github.com/BVLC/caffe/wiki/Simple-Example:-Sin-Layer
https://github.com/BVLC/caffe/wiki/Development