From aa895d2a07860b0f3a4bb4e8be9c7fda636e75ce Mon Sep 17 00:00:00 2001 From: Glenn Jocher Date: Sat, 17 Nov 2018 14:37:36 +0100 Subject: [PATCH] updates --- models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/models.py b/models.py index b9e3f88d..bdf1a882 100755 --- a/models.py +++ b/models.py @@ -168,14 +168,14 @@ class YOLOLayer(nn.Module): if nM > 0: lx = k * MSELoss(x[mask], tx[mask]) ly = k * MSELoss(y[mask], ty[mask]) - lw = (k * 1) * MSELoss(w[mask], tw[mask]) - lh = (k * 1) * MSELoss(h[mask], th[mask]) + lw = k * MSELoss(w[mask], tw[mask]) + lh = k * MSELoss(h[mask], th[mask]) # lconf = k * BCEWithLogitsLoss(pred_conf[mask], mask[mask].float()) lconf = (k * 10) * BCEWithLogitsLoss(pred_conf, mask.float()) - # lcls = (k / 10) * CrossEntropyLoss(pred_cls[mask], torch.argmax(tcls, 1)) - lcls = (k * 10) * BCEWithLogitsLoss(pred_cls[mask], tcls.float()) + lcls = (k / 10) * CrossEntropyLoss(pred_cls[mask], torch.argmax(tcls, 1)) + # lcls = (k * 10) * 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])