models_actinf.py 文件源码

python
阅读 36 收藏 0 点赞 0 评论 0

项目:smp_base 作者: x75 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号