This commit is contained in:
Glenn Jocher 2019-08-02 01:33:24 +02:00
parent 79111cb18f
commit 6d1cafba3a
1 changed files with 1 additions and 1 deletions

View File

@ -223,7 +223,7 @@ def train(cfg,
# Update image weights (optional)
if dataset.image_weights:
w = model.class_weights.cpu().numpy() * (1 - maps) # class weights
w = model.class_weights.cpu().numpy() * (1 - maps) ** 2 # class weights
image_weights = labels_to_image_weights(dataset.labels, nc=nc, class_weights=w)
dataset.indices = random.choices(range(dataset.n), weights=image_weights, k=dataset.n) # rand weighted idx