def test_activation(self): network = MoodNeuralNetwork() self.assertEqual(0.7310585786300049, network.activation(1)) self.assertEqual(0.6224593312018546, network.activation(0.5)) self.assertEqual(0.5, network.activation(0)) self.assertEqual(0.3775406687981454, network.activation(-.5)) self.assertEqual(0.549833997312478, network.activation(0.2)) self.assertEqual(0.9999546021312976, network.activation(10)) self.assertEqual(4.719495271526123e-20, network.activation(-44.5)) self.assertEqual(0.52497918747894, network.activation(0.1))
def test_deriv_activation(self): network = MoodNeuralNetwork() self.assertEqual(0, network.deriv_activation(1)) self.assertEqual(0.25, network.deriv_activation(0.5)) self.assertEqual(0.5, network.activation(0)) self.assertEqual(-0.75, network.deriv_activation(-.5)) self.assertEqual(0.16000000000000003, network.deriv_activation(0.2)) self.assertEqual(-90, network.deriv_activation(10)) self.assertEqual(-2024.75, network.deriv_activation(-44.5)) self.assertEqual(0.09000000000000001, network.deriv_activation(0.1))