Simple neural network gives wrong output after training
问题 I've been working on a simple neural network. It takes in a data set with 3 columns, if the first column's value is a 1, then the output should be a 1. I've provided comments so it is easier to follow. Code is as follows: import numpy as np import random def sigmoid_derivative(x): return x * (1 - x) def sigmoid(x): return 1 / (1 + np.exp(-x)) def think(weights, inputs): sum = (weights[0] * inputs[0]) + (weights[1] * inputs[1]) + (weights[2] * inputs[2]) return sigmoid(sum) if __name__ == "_