caffe,deeplab,对Interp(差值)层的理解

更详细的参数解释查阅interp_layer.cpp。

prototxt中的用法:

layer{
  bottom:"input"
  top:"output"
  name:"interp_layer"
  type:"Interp"
  interp_param{
     shrink_factor:4
     zoom_factor:3
     pad_beg:0
     pad_end:0
}

interp_layer.cpp相关片段


#读入图片的高度和宽度
 height_in_ = bottom[0]->height();
 width_in_ = bottom[0]->width();

#根据设定参数调整后的高度,pad_beg,pad_end只能设置成0及0以下。
 height_in_eff_ = height_in_ + pad_beg_ + pad_end_;
 width_in_eff_ = width_in_ + pad_beg_ + pad_end_;

#interp的顺序是先缩小,再放大
 height_out_ = (height_in_eff_ - 1) / shrink_factor + 1;
 width_out_ = (width_in_eff_ - 1) / shrink_factor + 1;
 height_out_ = height_out_ + (height_out_ - 1) * (zoom_factor - 1);
 width_out_ = width_out_ + (width_out_ - 1) * (zoom_factor - 1);

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值