Weights not converging while cost function has converged in neural networks I'm talking in an ideal scenario where a validation set isn't used. Without validation, as many epochs as possible are calculated. Training stops and finishes only when the loss function is minimized and converged.
Activation is sigmoid. My loss function is mean squared error, weights being in the squared error, so the loss function is a quadratic function of the weights. There's no hidden nodes. My cost/loss function drops drastically and approaches 0, which looks a sign of convergence. But the weights are still changing in a visible way, a lot faster than the cost function. Why do the weights keep changing?
 A: There is nothing strange about the effect you observe: As long as the loss is not zero, the gradient will not be zero, and thus the gradient descent algorithm will keep updating the weights. How much they change in each iteration depends on the step size (learning rate) and the gradient. Unless you decrease the learning rate over time, your weights may oscillate around a local minimum forever.
Looking at the weights with a naked eye is not a very good criterion for checking convergence. However, there are various established strategies for deciding when to stop the learning algorithm. A common choices include:


*

*Training for a fixed number of epochs.

*Reaching a threshold value for training loss.

*Early stopping: Monitoring the loss on a hold-out dataset and stop once it starts increasing.


A paper by Soudry et al. [1] studies the properties of convergence of weights w.r.t. convergence of the training loss in logistic regression models. They observe that the convergence of weights is much slower that the convergence of the loss. They suggest that it is beneficial to keep training even when the loss has seemingly converged and  recommend using accuracy on the validation set to be a good criterion for terminating the training. Note that their paper does not discuss explicitly deep neural networks which are much more complicated to analyze, however their earlier empirical results show similar effects in neural nets, e.g. [2].

[1]: Soudry, D., Hoffer, E., Nacson, M.S., Gunasekar, S. and Srebro, N., 2018. The implicit bias of gradient descent on separable data. The Journal of Machine Learning Research, 19(1), pp.2822-2878.
[2]: Hoffer, E., Hubara, I. and Soudry, D., 2017. Train longer, generalize better: closing the generalization gap in large batch training of neural networks. In Advances in Neural Information Processing Systems (pp. 1731-1741).
A: This is perfectly possible in problems where a simpler neural network would have done the job. Think for example of a neural network that takes an input, passes it into a hidden layer (consisting of only one neuron) and then returns the output, which should be always 0.
Here we have two connections, but the only relevant one is the second. The value of the first one is irrelevant and therefore it could be changing arbitrarely producing always the same error.
A: One possible explanation is that the optimal weights are at infinity. Nevertheless, the loss function will be almost optimal already for finite weights. Thus, the weights can still grow notably, even though the loss function has converged already.
For some loss functions, such as the negative log-likelihood without regularization, this is a common phenomenon. Infinite weights are needed for the network to represent zero probabilities.
