Machine Learning Notes - Understanding the impact of learning rate on neural network performance

1. Brief description

        ​​​​Deep learning neural networks are trained using the stochastic gradient descent optimization algorithm. The learning rate is a hyperparameter that controls how much the model changes in response to estimation error each time the model weights are updated. A learning rate value that is too small may cause the training process to be too long and may get bogged down, while a value that is too large may result in suboptimal weights being learned too quickly or an unstable training process.

        When configuring a neural network, the learning rate is an important hyperparameter. Therefore, it is valuable to understand the impact of learning rate on model performance.

        The amount by which the weights are updated during training is called the step size or "learning rate".

2.Evaluation of different learning rates

        In this example, we evaluate the learning rate from 1E-0 to 1E-7 and create a line plot for each learning rate by calling the fit_model() function. Running the example creates a graph that contains eight line plots for eight different estimated learning rates. Classification accuracy for the training dataset is marked in blue, while classification accuracy for the test dataset is marked in orange.

# study of learning rate on accuracy for blobs problem
from sklearn.datasets import make_blobs
from keras.layers import Dense
from keras.models import Sequential
from keras.optimizers import SGD
from keras.utils import to_categorical
from m

Guess you like

Origin blog.csdn.net/bashendixie5/article/details/134828301