deflayers(n, m): """ Return *n* random Gaussian mixtures, each of length *m*. """ defbump(a): x = 1 / (.1 + np.random.random()) y = 2 * np.random.random() - .5 z = 10 / (.1 + np.random.random()) for i inrange(m): w = (i / m - y) * z a[i] += x * np.exp(-w * w) a = np.zeros((m, n)) for i inrange(n): for j inrange(5): bump(a[:, i]) return a