Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

what detail of MineHardExamples #6

Open
kingstarcraft opened this issue Mar 17, 2018 · 0 comments
Open

what detail of MineHardExamples #6

kingstarcraft opened this issue Mar 17, 2018 · 0 comments

Comments

@kingstarcraft
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant