Add colorstr() (#1887)

* Add colorful()

* update

* newline fix

* add git description

* --always

* update loss scaling

* update loss scaling 2

* rename to colorstr()
This commit is contained in:
Glenn Jocher authored and GitHub committed 2021-01-09 15:24:18 -08:00
1 parent 3e25f1e9e5
commit 6ab589583c
5 files changed
+60 -22

No files matched your search

+2 -4
View File
@@ -105,7 +105,6 @@ def compute_loss(p, targets, model): # predictions, targets, model
# Losses
nt = 0 # number of targets
no = len(p) # number of outputs
balance = [4.0, 1.0, 0.3, 0.1, 0.03] # P3-P7
for i, pi in enumerate(p): # layer index, layer predictions
b, a, gj, gi = indices[i] # image, anchor, gridy, gridx
@@ -138,10 +137,9 @@ def compute_loss(p, targets, model): # predictions, targets, model
lobj += BCEobj(pi[..., 4], tobj) * balance[i] # obj loss
s = 3 / no # output count scaling
lbox *= h['box'] * s
lbox *= h['box']
lobj *= h['obj']
lcls *= h['cls'] * s
lcls *= h['cls']
bs = tobj.shape[0] # batch size
loss = lbox + lobj + lcls