コード例 #1
0
ファイル: test_fuzzy_ops.py プロジェクト: fmmb/scikit-fuzzy
def test_sigmoid():
    a = np.arange(30) / 29.
    expected = np.array([
        0.4378235, 0.44207164, 0.44632827, 0.45059279, 0.45486458, 0.45914303,
        0.4634275, 0.46771738, 0.47201205, 0.47631085, 0.48061317, 0.48491837,
        0.48922581, 0.49353484, 0.49784484, 0.50215516, 0.50646516, 0.51077419,
        0.51508163, 0.51938683, 0.52368915, 0.52798795, 0.53228262, 0.5365725,
        0.54085697, 0.54513542, 0.54940721, 0.55367173, 0.55792836, 0.5621765
    ])

    test = sigmoid(a, 0.5)
    assert_allclose(test, expected)
コード例 #2
0
def test_sigmoid():
    a = np.arange(30) / 29.
    expected = np.array(
      [ 0.4378235 ,  0.44207164,  0.44632827,  0.45059279,  0.45486458,
        0.45914303,  0.4634275 ,  0.46771738,  0.47201205,  0.47631085,
        0.48061317,  0.48491837,  0.48922581,  0.49353484,  0.49784484,
        0.50215516,  0.50646516,  0.51077419,  0.51508163,  0.51938683,
        0.52368915,  0.52798795,  0.53228262,  0.5365725 ,  0.54085697,
        0.54513542,  0.54940721,  0.55367173,  0.55792836,  0.5621765 ])

    test = sigmoid(a, 0.5)
    assert_allclose(test, expected)