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); } }
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); } }
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); }
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); }