test_activations.py 文件源码

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

项目:keras-recommendation 作者: sonyisme 项目源码 文件源码
def test_tanh():

    from keras.activations import tanh as t
    test_values = get_standard_values()

    x = T.vector()
    exp = t(x)
    f = theano.function([x], exp)

    result = f(test_values)
    expected = [math.tanh(v) for v in test_values]

    print(result)
    print(expected)

    list_assert_equal(result, expected)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号