Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- n = 4
- weights = [random.random() for _ in range(n)]
- sum_weights = sum(weights)
- weights = [w/sum_weights for w in weights]
- print(weights)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement