FocalLoss icon indicating copy to clipboard operation
FocalLoss copied to clipboard

what detail of MineHardExamples

Open kingstarcraft opened this issue 6 years ago • 0 comments

In my code: for (map<int, vector >::iterator it = match_indices.begin(); it != match_indices.end(); ++it) { const int label = it->first; // Get positive indices. int num_pos = 0; for (int m = 0; m < match_indices[label].size(); ++m) { if (match_indices[label][m] != -1) { ++num_pos; } } num_matches_ += num_pos; if (do_neg_mining_) { // Get max scores for all the non-matched priors. vector<pair<float, int> > scores_indices; int num_neg = 0; for (int m = 0; m < match_indices[label].size(); ++m) { if (match_indices[label][m] == -1 && match_overlaps[label][m] < neg_overlap_) { scores_indices.push_back(std::make_pair(all_max_scores[i][m], m)); ++num_neg; } } // Pick top num_neg negatives. if (neg_pos_ratio_ >= 0){ num_neg = std::min(static_cast(num_pos * neg_pos_ratio_), num_neg); std::sort(scores_indices.begin(), scores_indices.end(), SortScorePairDescend); } for (int n = 0; n < num_neg; ++n) { neg_indices.push_back(scores_indices[n].second); } num_negs += num_neg; } } all_match_indices_.push_back(match_indices); all_neg_indices_.push_back(neg_indices); }

could you please tell me is that true?

kingstarcraft avatar Mar 17 '18 05:03 kingstarcraft