Adam to SGD with burn-in

This commit is contained in:
Glenn Jocher
2018-09-20 18:03:19 +02:00
parent 1cfde4aba8
commit a722601ef6
5 changed files with 48 additions and 35 deletions
+7 -5
View File
@@ -262,12 +262,14 @@ def build_targets(pred_boxes, pred_conf, pred_cls, target, anchor_wh, nA, nC, nG
# Coordinates
tx[b, a, gj, gi] = gx - gi.float()
ty[b, a, gj, gi] = gy - gj.float()
# Width and height (sqrt method)
# tw[b, a, gj, gi] = torch.sqrt(gw / anchor_wh[a, 0]) / 2
# th[b, a, gj, gi] = torch.sqrt(gh / anchor_wh[a, 1]) / 2
# Width and height (power method)
tw[b, a, gj, gi] = torch.sqrt(gw / anchor_wh[a, 0]) / 2
th[b, a, gj, gi] = torch.sqrt(gh / anchor_wh[a, 1]) / 2
# Width and height (yolov3 method)
tw[b, a, gj, gi] = torch.log(gw / anchor_wh[a, 0] + 1e-16)
th[b, a, gj, gi] = torch.log(gh / anchor_wh[a, 1] + 1e-16)
# tw[b, a, gj, gi] = torch.log(gw / anchor_wh[a, 0] + 1e-16)
# th[b, a, gj, gi] = torch.log(gh / anchor_wh[a, 1] + 1e-16)
# One-hot encoding of label
tcls[b, a, gj, gi, tc] = 1