def test_evaluateDerivativeOnVectors(self): sigmoid = Sigmoid() vector = num.array([1, 2, 3]) num.testing.assert_array_equal(sigmoid.derivative(vector), num.array([0, -2, -6]))
def test_evaluateDerivativeOnNumbers(self): sigmoid = Sigmoid() self.assertEqual(sigmoid.derivative(2), 2 * (1 - 2))