Perceptron and activation functions implementation