I am trying to determine the weights between the last hidden layer and output layer using a least square optimization, but I want to update all the remaining weights and biases