From 966bc16d1a4b4763bf5c7d1f329da47722acf411 Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sat, 10 Nov 2018 00:53:53 +0100 Subject: [PATCH] updates --- models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/models.py b/models.py index ab059cfa..b3c9a197 100755 --- a/models.py +++ b/models.py @@ -170,10 +170,10 @@ class YOLOLayer(nn.Module): lh = k * MSELoss(h[mask], th[mask]) # lconf = k * BCEWithLogitsLoss(pred_conf[mask], mask[mask].float()) - lconf = k * BCEWithLogitsLoss(pred_conf, mask.float()) + lconf = (k * 10) * BCEWithLogitsLoss(pred_conf, mask.float()) - # lcls = (k / 10) * CrossEntropyLoss(pred_cls[mask], torch.argmax(tcls, 1)) - lcls = k * BCEWithLogitsLoss(pred_cls[mask], tcls.float()) + lcls = (k / 10) * CrossEntropyLoss(pred_cls[mask], torch.argmax(tcls, 1)) + # lcls = k * BCEWithLogitsLoss(pred_cls[mask], tcls.float()) else: lx, ly, lw, lh, lcls, lconf = FT([0]), FT([0]), FT([0]), FT([0]), FT([0]), FT([0])