NNCOSTFUNCTON (nn_params, hidden_layer_size, num_labels, X, y, lambda) computes the cost and gradient of the neural network. The parameters for the neural network are "unrolled" into the vector nn_params and need to be converted back into the weight matrices.
The returned parameter grad should be a "unrolled" vector of the partial derivatives of the neural network.
NNCOSTFUNCTON (nn_params, hidden_layer_size, num_labels, X, y, lambda) computes the cost and gradient of the neural network. The parameters for the neural network are "unrolled" into the vector nn_params and need to be converted back into the weight matrices.
The returned parameter grad should be a "unrolled" vector of the partial derivatives of the neural network.