Add editing methods
This commit is contained in:
commit
f7d9c0193d
12 changed files with 161 additions and 0 deletions
10
editor/utils/random.py
Normal file
10
editor/utils/random.py
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import numpy as np
|
||||
|
||||
|
||||
def random(min: float = 0, max: float = 1):
|
||||
mu = (max + min) / 2 # Mean of the distribution
|
||||
sigma = (
|
||||
max - min
|
||||
) / 6 # Standard deviation, chosen so that ~99.7% fall within [min_val, max_val]
|
||||
sample = np.random.normal(mu, sigma)
|
||||
return np.clip(sample, min, max)
|
||||
Loading…
Add table
Add a link
Reference in a new issue