Optimization_Algorithm THe nn function calculate the change in weights from error function and gradient descent is used to optimize the result