test_sigmoid_op.py 462 字节
Newer Older
Q
qijun 已提交
1 2 3 4 5 6 7 8 9 10
import unittest
from op_test_util import OpTestMeta
import numpy as np


class TestSigmoidOp(unittest.TestCase):
    __metaclass__ = OpTestMeta

    def setUp(self):
        self.type = "sigmoid"
D
dangqingqing 已提交
11 12
        self.inputs = {'X': np.random.random((32, 100)).astype("float32")}
        self.outputs = {'Y': 1 / (1 + np.exp(-self.inputs['X']))}
Q
qijun 已提交
13 14


15
#class TestSigmoidGradOp(unittest.TestCase):
D
dangqingqing 已提交
16
#TODO(qingqing) add unit test
17

Q
qijun 已提交
18 19
if __name__ == '__main__':
    unittest.main()