Skip to content

Commit

Permalink
Update np.random.random() to random.random() (ultralytics#3967)
Browse files Browse the repository at this point in the history
  • Loading branch information
glenn-jocher committed Jul 11, 2021
1 parent d5e3032 commit f65e317
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion utils/autoanchor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Auto-anchor utils

import random

import numpy as np
import torch
import yaml
Expand Down Expand Up @@ -149,7 +151,7 @@ def print_results(k):
for _ in pbar:
v = np.ones(sh)
while (v == 1).all(): # mutate until a change occurs (prevent duplicates)
v = ((npr.random(sh) < mp) * npr.random() * npr.randn(*sh) * s + 1).clip(0.3, 3.0)
v = ((npr.random(sh) < mp) * random.random() * npr.randn(*sh) * s + 1).clip(0.3, 3.0)
kg = (k.copy() * v).clip(min=2.0)
fg = anchor_fitness(kg)
if fg > f:
Expand Down

0 comments on commit f65e317

Please sign in to comment.