Skip to content

Commit

Permalink
Merge pull request #7 from Wuziyi616/master
Browse files Browse the repository at this point in the history
fix IB bug
  • Loading branch information
ZiweiWangTHU authored Jul 22, 2020
2 parents c899972 + 2e89365 commit 3cf61d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions faster_rcnn/trainval_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,10 @@ def __len__(self):
args.rpn_reg_weight = 0.5
args.head_prior_weight = 0.05
args.head_reg_weight = 0.02
fasterRCNN.rpn_prior_weight = args.rpn_prior_weight
fasterRCNN.head_prior_weight = args.head_prior_weight
fasterRCNN.head_reg_weight = args.head_reg_weight
fasterRCNN.RCNN_rpn.reg_weight = args.rpn_reg_weight
adjust_learning_rate(optimizer, args.lr_decay_gamma)
lr *= args.lr_decay_gamma

Expand Down
4 changes: 3 additions & 1 deletion ssd/train_bidet_ssd.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ def train():
if step_index == 0:
args.reg_weight = 0.1
args.prior_weight = 0.2
REGULARIZATION_LOSS_WEIGHT = args.reg_weight
PRIOR_LOSS_WEIGHT = args.prior_weight
step_index += 1
adjust_learning_rate(optimizer, args.gamma, step_index)
print("decay lr")
Expand Down Expand Up @@ -280,7 +282,7 @@ def train():
loss_p += (-1. * log_scores.sum() / float(gt_num))
loss_count += 1.

loss_p /= loss_count
loss_p /= (loss_count + 1e-6)
loss_p *= PRIOR_LOSS_WEIGHT

# Calculate regularization loss on feature maps
Expand Down

0 comments on commit 3cf61d9

Please sign in to comment.