lmb-freiburg / flownet2

FlowNet 2.0: Evolution of Optical Flow Estimation with Deep Networks

Home Page:https://lmb.informatik.uni-freiburg.de/Publications/2017/IMKDB17/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parameters in L1 loss layer

adhara123007 opened this issue · comments

Hi Nikolaus,

Can you help me to understand the parameters in the L1 loss layer ?
what does the parameter 'l2 per location' do?

For example, How is one different from two?
---------one--------------------------------------
layer {
name: "flow_loss6"
type: "L1Loss"
bottom: "predict_flow6"
bottom: "blob30"
top: "flow_loss6" loss_weight: 0.2
l1_loss_param { l2_per_location: false normalize_by_num_entries: true }
}

-------------------two-------------------------------------
layer {
name: "flow_loss6"
type: "L1Loss"
bottom: "predict_flow6"
bottom: "blob30"
top: "flow_loss6"
loss_weight: 0.2
l1_loss_param { l2_per_location: true }
}

See src/caffe/layers/l1loss_layer.cpp, lines 11 et seqq.

Without l2_per_location, the L1Loss layer simply computes the difference between estimate and groundtruth.
With l2_per_location, this difference is further subjected to a square-sum-squareroot computation (the sum is implemented as a 1×1 convolution) which leads to more punishment for outliers.

I believe normalize_by_num_entries instructs the layer to normalize by the number of valid pixels, instead of by the total number of pixels. If I'm right, this is necessary for sparse data (like KITTI) but it means more computation.

Thank You very much. It was really helpful.