huangyangyu / NoiseFace

Noise-Tolerant Paradigm for Training Face Recognition CNNs [Official, CVPR 2019]
https://arxiv.org/pdf/1903.10357.pdf
MIT License
136 stars 23 forks source link

about noise_tolerant_fr_layer.cpp #8

Open 994374821 opened 5 years ago

994374821 commented 5 years ago

`

  1. // mean filtering of the distribution
  2. Dtype sum_filter_pdf = 0.0;
  3. std::vector filterpdf(bins+1, Dtype(0.0));
  4. for (int i = fr; i <= bins_-fr; i++)
  5. {
  6. for (int j = i-fr; j <= i+fr; j++)
  7. {
  8. filterpdf[i] += pdf[j] / (fr+fr+1);
  9. }
  10. sum_filter_pdf += filter_pdf[i];
  11. }
  12. // update probability cumulative function
  13. pcf_[0] = filter_pdf[0] / sum_filter_pdf;
  14. for (int i = 1; i <= bins_; i++)
  15. {
  16. pcf[i] = pcf[i-1] + filter_pdf[i] / sum_filter_pdf;
  17. }

` the pdf[0] will be 0 after line14, why set pdf[0] to 0? Does it make sence?

huangyangyu commented 5 years ago

pdf is probability distribution function, pdf[0] = 0 means the value in first bin of pdf is zero. filter_pdf is the smooth version of pdf. We extend some bins at the begin/end side of pdf to make the filter_pdf computation more convenient. That's it.