示例#1
0
void backward_reorg_old_layer(const layer l, network_state state)
{
	if (l.reverse) {
		reorg_cpu(l.delta, l.w, l.h, l.c, l.batch, l.stride, 0, state.delta);
	}
	else {
		reorg_cpu(l.delta, l.w, l.h, l.c, l.batch, l.stride, 1, state.delta);
	}
}
示例#2
0
void forward_reorg_old_layer(const layer l, network_state state)
{
	if (l.reverse) {
		reorg_cpu(state.input, l.w, l.h, l.c, l.batch, l.stride, 1, l.output);
	}
	else {
		reorg_cpu(state.input, l.w, l.h, l.c, l.batch, l.stride, 0, l.output);
	}
}
示例#3
0
 void ReorgLayer<Dtype>::Forward_cpu(const vector<Blob<Dtype> *> &bottom,
                                     const vector<Blob<Dtype> *> &top) {
     const Dtype *bottom_data = bottom[0]->cpu_data();
     Dtype *top_data = top[0]->mutable_cpu_data();
     reorg_cpu(bottom_data, width_, height_,
               channels_, batch_num_, stride_, reverse_, top_data);
 }
示例#4
0
 void ReorgLayer<Dtype>::Backward_cpu(const vector<Blob<Dtype> *> &top, const vector<bool> &propagate_down,
                                      const vector<Blob<Dtype> *> &bottom) {
     if(!propagate_down[0]){
         return;
     }
     //const Dtype *top_diff = top[0]->cpu_diff();
     const Dtype *top_diff = diff_.mutable_cpu_diff();
     Dtype *bottom_diff = bottom[0]->mutable_cpu_diff();
     reorg_cpu(top_diff, width_, height_,
               channels_, batch_num_, stride_, !reverse_, bottom_diff);
 }