Simulated annealing - not always a good idea
Issue Description
On an advice of @treo, filing an issue about a lately performed experiment on using simulated annealing for weight optimization.
I have tried implementing simulated annealing for weight optimization. The initial reference was this paper. I have altered the MNISTSingleLayerExample to perform the computations. The two models: he current an a newly proposed, were then compared on a random batch.
Parametrization
The following parametrization and initiation techniques were used:
- 1000 and 100-neuron ReLU hidden layers;
- F1-score and L2-norm as cost functions;
- numerous temperature regimes and probability functions to choose, whether a worse-performing model is to be chosen (simulated annealing);
- re-initialization and adding a random parameter matrix with uniformly distributed weights for an annealing step;
- different number of epochs, eventually depending on the temperature regime (in this case, comparisons between current and contender models).
- different batch sizes: from 128 to 10000;
Results
In all the experiments, the model was prone to overfitting: after 100 or so epochs it stuck to recognizing 1-2, in rare cases 4 digits out of 10, completely ignoring the rest.
The main difference of the approach taken here was that, instead of convolutional layer, fully connected layers were used. As a result, the model had ~80000 parameters for 100-neuron hidden layer. The cited article provided no relevant information about the temperature regime, but since cnn were used, the number of parameters seems to be several orders of magnitude smaller.
Conclusion
The analysis shows that using blunt simulated annealing to optimize high-dimensional networks is not advantageous. Further experiments, mixing stochastic gradient descent with simulated annealing, are on the way.