Пример #1
def width_gumbel(max_width, num_profiles, num_samples):
    """Gumbel width distribution

    Generates scales in U[0, max_width]
    scales = rand.uniform(0, max_width, num_profiles)
    return rand.gumbel(0, scales, (num_samples, num_profiles)).T
Пример #2
def gumbel_noise(scale, samples, flip_prob=0.5):
	Generate random noise according to a gumbel distribution.

	Gumbel distributions are skewed, so the default setting of the flip_prob
	parameter makes it equally likely to be skewed positive or negative

    location = -0.5772 * scale
    multiplier = -1 if (U(0, 1) < flip_prob) else 1
    return multiplier * gumbel(location, scale, samples)