Optimization and number of conditions: why the same rate of learning is stunned and shaken
The two-dimensional secondary function deduces a steady step, connecting the feature scaling, pre-conditions, momentum and actual training diagnostics.
Learning objectives and first steps4 objectives 2 first repairs
Try to do it after reading
- The gradient of the secondary target decreases and stabilizes the area using characteristic values
- A process of stability, criticality and instability
- Distinguishing the roles of condition numbers, target scales and gradient cropping
- Examining different evidence of optimisation failures and data protocol problems
Suggested first
- Literal, gradient and vector parameters
- Symmetric matrix and feature values
When the loss is shaken, you'll have to judge what's being optimized
The training curves may be based on learning rates, sample noise, mixing accuracy, error gradients plus or evaluation of statistical transitions. Direct switch of optimizers often obscures the problem. A determinative secondary function separates the most basic mechanisms: different curves in different directions, and uniform learning rates are limited by the steepest directions. This mechanism also explains some of the training difficulties when the tabular characterizations vary and when the depth network gradient scale varies, but it does not cover all non-coupled phenomena.
This chapter requires gradients, matrix characteristics and equivalencies. The objective is to calculate the permissible length of step directly from the update, to check the values of stability and instability at the same initial point, and to understand how scaling changes the optimal geometry. All functions and coordinates are set for synthetic teaching, not a model training curve or a practical business experiment.
A fast-direction, a slow-direction secondary target
Take f(x,y) = one-half times (x 2+10 y 2). The gradient is (x, 10 y) and Hessian is a digonometric matrix diag(1,10) with a minimum point (0,0). It is a rectangular target with two curvature characteristics of 1 and 10 and a second-calibration condition of 10. The target is growing faster by the same distance along the direction of y; The high line is therefore an ellipse long along the x.
Here e is current error relative to the optimum. Along each eigendirection it is multiplied by (1−ηλ) each round. Contraction requires absolute value below one, so a fixed positive step must be less than 2 divided by the largest eigenvalue. Equality need not converge; larger steps can alternate and amplify error. This is exact for this quadratic, not a global step guarantee for arbitrary deep networks.Non-binding minimization chapter for Boyd and Vandenberghe A relevant condensed analysis was given.
Two steps for gradual verification
Start at (2,1), objective 7. With η=0.1, x is multiplied by 0.9 and y by 0. The first point (1.8,0) has objective 1.62; the second (1.62,0) has 1.3122. After the steep direction disappears, the flat direction contracts slowly. With η=0.25, multipliers are 0.75 and −1.5. Points (1.5,−1.5) and (1.125,2.25) have objectives 12.375 and 25.9453125.
η=0.2 is the boundary: y oscillates without decay while x contracts. Small gradients in flat directions can misleadingly suggest convergence; consider objective gaps, parameter changes and task tolerances. Lower training loss also does not establish better generalization or policy returns, which require independent evaluation.
Why are the scaling and preconditions valid
New coordinates z 1 = x, z 2 = Root ten times y, target becomes one-half times (z 12 + z 22) and the curvature is unified. The curve difference between the two directions may also be offset directly by multiplying the original gradient by diag(1,0.1). This is called a simple example of preconditions; It changes the geometry, not the creation of more training information.Continuous optimization part of MML Fits to link coordinates to gradients.
In practice, the complete Hessian cannot always be known, and the standardization of features, the homogenization layer and the self-adaptation optimists can only improve the scale under their respective assumptions. Adam is updated on the basis of the first and second-step-strategy estimates, which are not precise Newton law and do not guarantee stability of any goal or step. Zero deviation fixes, epsilon and the location of the realization of weight decays affect the results and should be checked Adam original paper and use a specific interface to the frame, not just a default learning rate.
The momentum will introduce a step-by-step direction that will change the way of stabilizing the zone and oscillating; It is not possible to directly follow the immobility of this chapter. Gradient cropping limits the range of a given update and is suitable for handling an anomaly gradient, but may change the optimised path; It could not repair the mislabelling, loss of boundaries or serious leakage. Different average batch methods also change the gradient scale, so adding sample weights to re-check the denominator and then judge whether the learning rate is reasonable.
Accuracy recovery of standard Python
The following example of the Python 3 standard library has been implemented in CPU. It only checks for precise secondary targets, does not use the in-depth learning framework and does not simulate random batch.
import math
def objective(x,y): return (x*x+10*y*y)/2
def run(eta, steps=2): x,y=2.0,1.0 values=[objective(x,y)] for _ in range(steps): x,y=x-eta*x,y-eta*10*y values.append(objective(x,y)) return x,y,values
stable=run(.1)unstable=run(.25)assert all(b<a for a,b in zip(stable[2],stable[2][1:]))assert all(b>a for a,b in zip(unstable[2],unstable[2][1:]))assert math.isclose(unstable[2][-1],25.9453125)print(stable) # (1.62, 0.0, [7.0, 1.62, 1.3122])print(unstable) # (1.125, 2.25, [7.0, 12.375, 25.9453125])x,y=2.0,1.0x,y=x-.8*x,y-.8*.1*(10*y) # 对角预条件assert math.isclose(objective(x,y), .28)From this example to training diagnostics
A small batch of data will be fixed, random enhancements will be closed and forward, gradients and an update will be checked to the extent permitted by float accuracy. Another attempt was made to combine very small samples and to see whether the training target was close to expectations. The random batch, enhanced, mixed accuracy and distribution are then restored item by item. This split distinguishes arithmetic errors from statistical problems; It does not in itself constitute evidence that the model can go online.
If fluctuations are seen only on the loss, check whether the validation is cut to the reasoning mode, whether random sampling is still available, whether consistent denominators are used, and whether label maturity changes with date. If the optimist state is lost when training is resumed, the curve may also suddenly jump. For each experiment, target formulas, weights, data versions, step schedule and recovery status are more easily located than the preservation of only one final model file.
Self-measure and answer
Why must the steady pace be less than 0.2?
A maximum curvature of 10, a steep error in direction multiplied by 1-10 zirconium, with an absolute value less than 1 required 0 < 0.2 < < > .
Why is x in the middle of a retreat without the whole?
x multiplied by 0.8, but y multiplied by -1 always retained the same range. One direction alone leaves the problem.
=0.1 Why eliminate y from the first step?
(b) The error factor of 1 to 0.1 x 10 is zero; This is a special value for an exact secondary function, not a general network nature.
Is the original learning rate appropriate by multiplying the target by 100?
Hessian is expanded 100 times simultaneously with the gradient and the stability ceiling is reduced 100 times. There are problems of the same scale as average change.
Can Adam make any learning rate safe?
Can't. It changes the updated scales of the coordinates and still relies on hyper-parameters, gradient statistics and the nature of the objectives; Nor does it amount to an exact Hessian counter.
Does the continued decline in the target of training prove that the benefits of the risk strategy have increased?
Can't. Optimizing success, generalizing quality, counterfactual recognition and strategic value are different levels that need to be validated separately.
Read it next Linear Modeling and Regularization Understand the direction of the small feature values and use them again Training cycle Checks whether the procedure actually achieved the expected update.
Sources and reconciliations
Definitions, methods and interfaces are available.
- Convex Optimization — Boyd and Vandenberghe
- Mathematics for Machine Learning — continuous optimization
- Adam — A Method for Stochastic Optimization
Figures and calculations are reorganized according to this chapter. Mathematical measurements, framework operations and real business effects are described separately in the body of the text.