Skip to content

Commit

Permalink
bug fix (*fast-rcnn* issue rbgirshick#69; thanks to @guyrose3 for poi…
Browse files Browse the repository at this point in the history
…nting this out)
  • Loading branch information
rbgirshick committed Oct 20, 2015
1 parent 54d2576 commit 19062d5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tools/train_svms.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,13 @@ def train(self):
print((' {:d}: obj val: {:.3f} = {:.3f} '
'(pos) + {:.3f} (neg) + {:.3f} (reg)').format(i, *losses))

return ((w * self.feature_scale, b * self.feature_scale),
pos_scores, neg_scores)
# Sanity check
scores_ret = (
X * 1.0 / self.feature_scale).dot(w.T * self.feature_scale) + b
assert np.allclose(scores, scores_ret[:, 0], atol=1e-5), \
"Scores from returned model don't match decision function"

return ((w * self.feature_scale, b), pos_scores, neg_scores)

def append_neg_and_retrain(self, feat=None, force=False):
if feat is not None:
Expand Down

0 comments on commit 19062d5

Please sign in to comment.