def generate_inverted_sinewave_dataset(N = 1000, f = 1.0, p = 0.0, a1 = 1.0, a2 = 0.3):
"""models_actinf.generate_inverted_sinewave_dataset
Generate the inverted sine dataset used in Bishop's (Bishop96)
mixture density paper
Returns:
- matrices X, Y
"""
X = np.linspace(0,1,N)
# FIXME: include phase p
Y = a1 * X + a2 * np.sin(f * (2 * 3.1415926) * X) + np.random.uniform(-0.1, 0.1, N)
X,Y = Y[:,np.newaxis],X[:,np.newaxis]
# pl.subplot(211)
# pl.plot(Y, X, "ko", alpha=0.25)
# pl.subplot(212)
# pl.plot(X, Y, "ko", alpha=0.25)
# pl.show()
return X,Y
评论列表
文章目录