caffe-net construct flow

来源:互联网 发布:工行黄金交易软件 编辑:程序博客网 时间:2024/06/15 01:40

1. it will call a Init func when init a net instance

template <typename Dtype>Net<Dtype>::Net(const NetParameter& param, const Net* root_net)    : root_net_(root_net) {  Init(param);}

2. init func

i. call layers setup func

  void SetUp(const vector<Blob<Dtype>*>& bottom,      const vector<Blob<Dtype>*>& top) {    InitMutex();    CheckBlobCounts(bottom, top);    LayerSetUp(bottom, top);    Reshape(bottom, top);    SetLossWeights(top);  }

...

 layer_setup_func and reshape_func of each layer will run only once when init the net, in the traing process will not invoke these funcs, so do not put variable or help func in setup_func or reshape_func when using value of bottom[i] data

0 0