사용자 도구

사이트 도구


python:random

문서의 이전 판입니다!


Python: random

log-uniform distribution

def log_uniform(low=0, high=1, size=None):
    return np.exp(np.random.uniform(np.log(low), np.log(high), size))
 
 
xs = np.log(log_uniform(0.04, 0.0001, 10000))
import matplotlib.pyplot as plt
plt.hist(xs, bins=100); plt.show()
python/random.1542719685.txt.gz · 마지막으로 수정됨: (바깥 편집)