Skip to text

2 Training methods

In this section, we provide a comprehensive explanation of the fundamental principles and techniques associated with the TR and APTS methods, focusing on their application to the training of NNs.

2.1 Trust-region method

TR methods [44], [11] are advanced globally convergent iterative algorithms utilized in nonlinear, convex, and nonconvex optimization to find local minima of objective functions. These methods iteratively construct a simplified model of the objective function within a localized vicinity of the iterate estimate, referred to as the trust region. The size of the trust region is adaptively adjusted at each iteration to ensure an accurate approximation of the true function behavior.

More precisely, in the TR framework at iteration k, the optimization problem (8.1) is approximated by a first- or second-order model mk. In order to obtain the search direction sk, the model mk is minimized as follows:

(8.2)min‖s‖≤Δkmk(s)=min‖s‖≤Δk∇ℓ(θk;D)Ts+12sTHks,

where Hk∈Rn×n is a symmetric matrix, typically an approximation to the Hessian of ℓ at θk, and Δk>0 is the TR radius. In case of a first-order model mk, the quadratic term in (8.2) vanishes. The quality of the step sk obtained by solving (8.2) is assessed using the ratio

(8.3)ρk=ℓ(θk)−ℓ(θk+sk)mk(0)−mk(sk),

where ℓ(θk)−ℓ(θk+sk) is the actual reduction and mk(0)−mk(sk) is the predicted reduction. The TR radius and parameters are then updated based on the value of ρk. If ρk≈1, the model mk provides a good approximation of the objective function, so the TR radius can be increased and the parameters can be updated. Otherwise, if ρk is smaller than a given threshold η>0, the TR radius is shrunk and the parameters remain unchanged. We refer the reader to [11] for a more detailed explanation and the algorithm.

In this work, we adopt the Limited-memory Symmetric Rank 1 (LSR1) method [18], [44] for approximating the Hessian of ℓ. The LSR1 approach systematically generates an approximation of the Hessian matrix by incorporating Rank 1 updates derived from gradient differences at each iteration. As the number of updates accumulates and reaches the predetermined limit, l, the most recent update replaces the oldest one, ensuring that the total number of updates remains constant at l. Unlike the LBFGS method, which ensures a positive definite approximated Hessian, the LSR1 method allows for an indefinite Hessian approximation, potentially providing more accurate curvature information.

In order to solve efficiently the subproblem (8.2), we employ the Orthonormal Basis SR1 (OBS) technique proposed in [7]. The OBS method leverages an orthonormal basis spanned by the LSR1 updates to transform the dimensions of the TR subproblem from n×n to a more manageable m×m, where typically m≪n.

2.2 APTS with the decomposition of network’s parameters

APTS [24] is a right-preconditioned TR strategy designed for solving non-convex optimization problems. In this work, we construct the nonlinear preconditioner by utilizing the layerwise decomposition of NN’s parameters [35]. Thus, in order to define the N subdomains, we introduce the projectors

(8.4)Ri:Rn⟶Rni,i=1,…,N,withRiRjT=0,∀i≠j,

where the second property implies that the subsets of parameters generated by Ri are pairwise disjoint. Here, n denotes the dimensionality of the global parameter vector, and ni represents the dimensionality of the local parameter vector, associated with the ith subdomain. We can now define the ith network copy as Ni(·;θi,ϕi,D), where the subdomain parameters θi=Riθ are defined as the set of trainable parameters. Moreover, with a slight abuse of notation, we define ϕi=θ∖θi as the remaining nontrainable parameters. Clearly, the overall structure of N does not change—what changes is the trainable/nontrainable setting of its parameters.

The APTS algorithm can be executed using the entire data set or on minibatches, with the latter scenario being referred to as Stochastic APTS (SAPTS). Although the convergence proof of the deterministic version does not transfer directly to the stochastic version, the numerical results provided in Section 3 are promising. Algorithm 8.1 provides a summary of the proposed APTS training algorithm. In steps 3 and 5, we establish the convergence criteria and select the training approach, which can be either using the full data set (APTS) or employing a mini-batch strategy (SAPTS). In steps 6–7, we compute and store the loss and gradient with the current training data set. The vector g is normalized in step 7 so that it has a similar length to s (see step 12), such that their contribution is similar in step 17. In step 9, we synchronize all the local TR radii ΔL,i with the global one and all the network copies, Ni, with the current global parameters from N. This synchronization preserves the state of trainable and nontrainable parameters that were previously established. Following this, in step 10, we initiate a series of TR iterations for each local network copy, which we call local TR iterations. At each iteration, the local TR algorithm will perform steps with length in the interval [ΔminL,ΔmaxL] with increase/decrease factors α, β, and reduction/acceptance ratios η1, η2. This process iterates until the cumulative step size falls below the predefined global TR radius, ΔG, signified by the condition si,jk=‖θi,0k−θi,jk‖∞≤ΔG, where i denotes the submodel and 0 and j are the local TR iterations. The iteration halts when either si,jk equals ΔG or when the iteration count reaches ν.

Algorithm 8.1: Scheme of APTS/SAPTS in weight.

Following the local TR iterations, step 11 involves aggregating all the updated weights from the local networks and summing them up. Here, we emphasize that the update sk made in step 12 is bounded by the global TR radius ΔG, that is,

‖θk−θ˜‖∞=‖∑i=1NRiTθi,0k−∑i=1NRiTθi,newk‖∞=‖∑i=1NRiT(θi,0k−θi,newk)‖∞≤ΔG.

In addition, the operator RiT serves the specific purpose of padding the vector θi,newk with zeros, transforming it to the same dimensionality as θk. This ensures a nonoverlapping aggregation during the summation process of RiTθi,newk across i=1,…,N, a condition which follows from the property of Ri delineated in equation (8.4).

In step 13, we evaluate the preconditioning step, that is, the search direction obtained during the preconditioning iteration. This direction is then used to update the weights of the global model in step 14. In steps 15–17, in case the forced decreasing loss (fdl) input variable is set to True, we make sure that the current loss ℓ(θk+12;D) on the global model is smaller than the old loss ℓk. If this is not a case, then we modify sk by averaging it with the gradient gk. Moreover, we reduce the radius Δ˜ to shrink sk. This process is different from the one in [24] and it is inspired by the Dogleg method [44], which is repeated until a step is accepted or until the step is the gradient, that is, when w=1.

In the final phase, a single TR iteration is executed on the global neural network N in step 18. The resulting step will have length in [ΔminG,ΔmaxG] and TR will be set with increase/decrease factors α, β and reduction/acceptance ratios η1, η2.