def layers(n, m):
    """
    Return *n* random Gaussian mixtures, each of length *m*.
    """
    def bump(a):
        x = 1 / (.1 + np.random.random())
        y = 2 * np.random.random() - .3
        z = 13 / (.1 + np.random.random())
        for i in range(m):
            w = (i / float(m) - y) * z
            a[i] += x * np.exp(-w * w)
    a = np.zeros((m, n))
    for i in range(n):
        for j in range(12):
            bump(a[:, i])
    return np.abs(a)
def layers ( n , m ) : def bump ( a ) : x = 1 / ( .1 + np . random . random ( ) ) y = 2 * np . random . random ( ) - .3 z = 13 / ( .1 + np . random . random ( ) ) for i in range ( m ) : w = ( i / float ( m ) - y ) * z a [ i ] += x * np . exp ( - w * w ) a = np . zeros ( ( m , n ) ) for i in range ( n ) : for j in range ( 12 ) : bump ( a [ : , i ] ) return np . abs ( a )
Return *n* random Gaussian mixtures, each of length *m*.