## 3 Related Work
Let us consider a typical four-layer Convolutional Neural Network (CNN) followed by a single linear layer. If we repeat the Inner Loop Learning N times, then the inference graph comprises 5N layers in total, without any skip connections. Since the original MAML only uses the final weights for the Outer Loop Learning, the backpropagation algorithm has to go through all layers, which causes gradient degradation. To solve the above problem, the Multi-Step Loss (MSL) optimization approach was adopted. It eliminates the problem by calculating the external loss after each internal step, based on the outer loop update, as in Equation (15) below:  
\[\theta=\theta-\beta\
abla_{\theta}\sum\
olimits_{i=1}^{B}\sum\
olimits_{j=1} ^{N}w_{j}L_{T_{i}}\Big{(}f_{\theta_{j}^{i}}\Big{)}, \tag{15}\]  
where \(\beta\) is a Learning Rate; \(L_{T_{i}}(f_{\theta_{j}^{i}})\) denotes the outer loss of task \(i\) when using the base-network weights after the \(j\)-inner-step update; and \(w_{j}\) denotes the importance weight of the outer loss at step \(j\). The following, Figure 4, is a graphical display of the MAML++ algorithm, where the outer loss is calculated after each internal step and the weighted average is obtained at the end of the process. In practice, all losses are initialized with equal contributions to the overall loss, but as repetitions increase, contributions from previous steps are reduced, while the ones of subsequent steps keep increasing gradually. This is to ensure that as training progresses, the final step loss receives more attention from the optimizer, thereby ensuring that the lowest possible loss is achieved. If the annealing is not used, the final loss might be higher compared to the one obtained by the original formulation. Additionally, due to the fact that the original MAML overcomes the second-order derivative cost by completely ignoring it, the final general performance of the network is reduced. The MAML++ solves this problem, by using the _derivative order annealing_ method. Specifically, it employs the first order grade for the first 50 epochs of training and then it moves to the second order grade for the rest of the training process. An interesting observation is that this derivative-order annealing does not create incidents of exploding or diminishing gradients, and so the training is much more stable. Another drawback of MAML is the fact that it does non-use _batch normalization statistic accumulation_. Instead, only the statistics of the current batch are used. As a result, smoothing is less effective, as the trained parameters must include a variety of different means and standard deviations from different tasks. A naive application would accumulate current batch statistics at all stages of the Inner Loop Learning update, which could cause optimization problems, and it could slow or stop optimization altogether. The problem stems from the erroneous assumption that the original model and all its  
Figure 3: Stabilizing MAML. updated iterations have similar attribute distributions. Thus, the current statistics could be shared across all updates to the internal loop of the network. Obviously, this assumption is not correct. A better alternative solution, which is employed by MAML++, is the storage of _per-step batch normalization statistics_ and the reading of _per-step batch normalization weights and_ biases for each repetition of the inner loop. One issue that affects the speed of generalization and convergence is the use of a _shared Learning Rate_ for all parameters and all steps of learning process update. The consistent Learning Rate requires multiple hyperparameter searches, in order to find the right rate for a particular set of data. This is computationally expensive and time consuming, depending on how the search is shared. Use the shared Learning Rate for all parameters and all the steps of updating the learning process. In addition, while gradient is an effective data fitting tactic, a constant Learning Rate can easily lead to overfitting under the _few-shot regime_.