Implementation of gradient descent algorithm, Neural Network