datasets.py 文件源码

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

项目:nnlib 作者: inejc 项目源码 文件源码
def xor_data(num_examples, noise=None):
    X = randn(num_examples, 2)

    if noise is None:
        X_ = X
    else:
        X_ = X + noise * randn(num_examples, 2)

    y = np.logical_xor(X_[:, 0] > 0, X_[:, 1] > 0).astype(int)
    return X, y
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号