Truncated Back-propagation for Bilevel Optimization
Amirreza Shaban, Ching-An Cheng, Nathan Hatch, Byron Boots
INTRODUCTION
Bilevel optimization has been recently revisited as a theoretical framework for designing and analyzing algorithms for hyperparameter optimization and meta learning . Mathematically, these problems can be formulated as a stochastic optimization problem with an equality constraint (see Section 1.1):
where and are the parameter and the hyperparameter, and are the expected and the sampled upper-level objective, is the sampled lower-level objective, and is a random variable called the context. The notation means that equals the unique return value of a prespecified iterative algorithm (e.g. gradient descent) that approximately finds a local minimum of . This algorithm is part of the problem definition and can also be parametrized by (e.g. step size). The motivation to explicitly consider the approximate solution rather than an exact minimizer of is that is usually not available in closed form. This setup enables to account for the imperfections of the lower-level optimization algorithm.
Solving the bilevel optimization problem in (1) is challenging due to the complicated dependency of the upper-level problem on induced by . This difficulty is further aggravated when and are high-dimensional, precluding the use of black-box optimization techniques such as grid/random search and Bayesian optimization .
Recently, first-order bilevel optimization techniques have been revisited to solve these problems. These methods rely on an estimate of the Jacobian to optimize . Pedregosa and Gould et al. assume that and compute by implicit differentiation. By contrast, Maclaurin et al. and Franceschi et al. treat the iterative optimization algorithm in the lower-level problem as a dynamical system, and compute by automatic differentiation through the dynamical system. In comparison, the latter approach is less sensitive to the optimality of and can also learn hyperparameters that control the lower-level optimization process (e.g. step size). However, due to superlinear time or space complexity (see Section 2.2), neither of these methods is applicable when both and are high-dimensional .
Few-step reverse-mode automatic differentiation and few-step forward-mode automatic differentiation have recently been proposed as heuristics to address this issue. By ignoring long-term dependencies, the time and space complexities to compute approximate gradients can be greatly reduced. While exciting empirical results have been reported, the theoretical properties of these methods remain unclear.
In this paper, we study the theoretical properties of these truncated back-propagation approaches. We show that, when the lower-level problem is locally strongly convex around , on-average convergence to an -approximate stationary point is guaranteed by -step truncated back-propagation. We also identify additional problem structures for which asymptotic convergence to an exact stationary point is guaranteed. Empirically, we verify the utility of this strategy for hyperparameter optimization and meta learning tasks. We find that, compared to optimization with full back-propagation, optimization with truncated back-propagation usually shows competitive performance while requiring half as much computation time and significantly less memory.
The goal of hyperparameter optimization is to find hyperparameters for an optimization problem such that the approximate solution of has low cost for some cost function . In general, can parametrize both the objective of and the algorithm used to solve . This setup is a special case of the bilevel optimization problem (1) where the upper-level objective does not depend directly on . In contrast to meta learning (discussed below), can be deterministic . See Section 4.2 for examples.
Many low-dimensional problems, such as choosing the learning rate and regularization constant for training neural networks, can be effectively solved with grid search. However, problems with thousands of hyperparameters are increasingly common, for which gradient-based methods are more appropriate .
Another important application of bilevel optimization, meta learning (or learning-to-learn) uses statistical learning to optimize an algorithm over a distribution of tasks and contexts :
It treats as a parametric function, with hyperparameter , that takes task-specific context information as input and outputs a decision . The goal of meta learning is to optimize the algorithm’s performance (e.g. the generalization error) across tasks through empirical observations. This general setup subsumes multiple problems commonly encountered in the machine learning literature, such as multi-task learning and few-shot learning .
Bilevel optimization emerges from meta learning when the algorithm computes by internally solving a lower-level minimization problem with variable . The motivation to use this class of algorithms is that the lower-level problem can be designed so that, even for tasks distant from the training set, falls back upon a sensible optimization-based approach . By contrast, treating as a general function approximator relies on the availability of a large amount of meta training data .
In other words, the decision is where is an approximate minimizer of some function . Therefore, we can identify
BILEVEL OPTIMIZATION
2 Computing the hypergradient
Like , we treat the iterative optimization algorithm that solves the lower-level problem as a dynamical system. Given an initial condition at , the update rule can be written asFor notational simplicity, we consider the case where is the state of (4); our derivation can be easily generalized to include other internal states, e.g. momentum.
in which defines the transition and and is the number iterations performed. For example, in gradient descent, , where is the step size.
By unrolling the iterative update scheme (4) as a computational graph, we can view as a function of and compute the required derivative . Specifically, it can be shown by the chain ruleNote that this assumes is twice differentiable.
where , for , and .
The computation of (5) can be implemented either in reverse mode or forward mode . Reverse-mode differentiation (RMD) computes (5) by back-propagation:
and finally . Forward-mode differentiation (FMD) computes (5) by forward propagation:
TRUNCATED BACK-PROPAGATION
In this paper, we investigate approximating (5) with partial sums, which was previously proposed as a heuristic for bilevel optimization ( Eq. 3, Eq. 2). Formally, we perform -step truncated back-propagation (-RMD) and use the intermediate variable to construct an approximate gradient:
This approach requires storing only the last iterates , and it also saves computation time. Note that -RMD can be combined with checkpointing for further savings, although we do not investigate this.
We first establish some intuitions about why using -RMD to optimize is reasonable. While building up an approximate gradient by truncating back-propagation in general optimization problems can lead to large bias, the bilevel optimization problem in (1) has some nice structure. Here we show that if the lower-level objective is locally strongly convex around , then the bias of can be exponentially small in . That is, choosing a small would suffice to give a good gradient approximation in finite precision. The proof is given in Appendix A.
Assume is -smooth, twice differentiable, and locally -strongly convex in around . Let . For , it holds
where . In particular, if is globally -strongly convex, then
Note since . Therefore, Proposition 3.1 says that if converges to the neighborhood of a strict local minimum of the lower-level optimization, then the bias of using the approximate gradient of -RMD decays exponentially in . This exponentially decaying property is the main reason why using to update the hyperparameter works.
Next we show that, when the lower-level problem is second-order continuously differentiable, actually is a sufficient descent direction. This is a much stronger property than the small bias shown in Proposition 3.1, and it is critical in order to prove convergence to exact stationary points (cf. Theorem 3.4). To build intuition, here we consider a simpler problem where is globally strongly convex and . These assumptions will be relaxed in the next subsection.
Let be globally strongly convex and . Assume is second-order continuously differentiable and has full column rank for all . Let . For all , with large enough and small enough, there exists , s.t. . This implies is a sufficient descent direction, i.e. .
The full proof of this non-trivial result is given in Appendix B. Here we provide some ideas about why it is true. First, by Proposition 3.1, we know the bias decays exponentially. However, this alone is not sufficient to show that is a sufficient descent direction. To show the desired result, Lemma 3.2 relies on the assumption that is second-order continuously differentiable and the fact that using gradient descent to optimize a well-conditioned function has linear convergence . These two new structural properties further reduce the bias in Proposition 3.1 and lead to Lemma 3.2. Here the full rank assumption for is made to simplify the proof. We conjecture that this condition can be relaxed when . We leave this to future work.
2 Convergence
With these insights, we analyze the convergence of bilevel optimization with truncated back-propagation. Using Proposition 3.1, we can immediately deduce that optimizing with converges on-average to an -approximate stationary point. Let denote the hypergradient in the th iteration.
Suppose is smooth and bounded below, and suppose there is such that . Using as a stochastic first-order oracle with a decaying step size to update with gradient descent, it follows after iterations,
That is, under the assumptions in Proposition 3.1, learning with converges to an -approximate stationary point, where .
We see that the bias becomes small as increases. As a result, it is sufficient to perform -step truncated back-propagation with to update .
Next, using Lemma 3.2, we show that the bias term in Theorem 3.3 can be removed if the problem is more structured. As promised, we relax the simplifications made in Lemma 3.2 into assumptions 2 and 3 below and only assume is locally strongly convex.
Under the assumptions in Proposition 3.1 and Theorem 3.3, if in addition
is second-order continuously differentiable
has full column rank around
the problem is deterministic (i.e. )
then for all , with large enough and small enough, the limit point is an exact stationary point, i.e. .
Theorem 3.4 shows that if the partial derivative does not interfere strongly with the partial derivative computed through back-propagating the lower-level optimization procedure (assumption 3), then optimizing with converges to an exact stationary point. This is a very strong result for an interesting special case. It shows that even with one-step back-propagation , updating can converge to a stationary point.
This non-interference assumption unfortunately is necessary; otherwise, truncating the full RMD leads to constant bias, as we show below (proved in Appendix E).
There is a problem, satisfying all but assumption 3 in Theorem 3.4, such that optimizing with does not converge to a stationary point.
Note however that the non-interference assumption is satisfied when , i.e. when the upper-level problem does not directly depend on the hyperparameter. This is the case for many practical applications: e.g. hyperparameter optimization, meta-learning regularization models, image desnosing , data hyper-cleaning , and task interaction .
3 Relationship with implicit differentiation
The gradient estimate is related to implicit differentiation, which is a classical first-order approach to solving bilevel optimization problems . Assume is second-order continuously differentiable and that its optimal solution uniquely exists such that . By the implicit function theorem , the total derivative of with respect to can be written as
Here we show that, in the limit where converges to , can be viewed as approximating the matrix inverse in (11) with an order- Taylor series. This can be seen from the next proposition.
Under the assumptions in Proposition 3.1, suppose converges to a stationary point . Let and . For , it satisfies that
By Proposition 3.6, we can write in (11) as
That is, captures the first terms in the Taylor series, and the residue term has an upper bound as in Proposition 3.1.
Given this connection, we can compare the use of and approximating (11) using steps of conjugate gradient descent for high-dimensional problems . First, both approaches require local strong-convexity to ensure a good approximation. Specifically, let locally around the limit. Using has a bias in , whereas using (11) and inverting the matrix with iterations of conjugate gradient has a bias in . Therefore, when is available, solving (11) with conjugate gradient descent is preferable. However, in practice, this is hardly true. When an approximate solution to the lower-level problem is used, adopting (11) has no control on the approximate error, nor does it necessarily yield a descent direction. On the contrary, is based on Proposition 3.1, which uses a weaker assumption and does not require the convergence of to a stationary point. Truncated back-propagation can also optimize the hyperparameters that control the lower-level optimization process, which the implicit differentiation approach cannot do.
EXPERIMENTS
This deterministic problem satisfies all of the assumptions in the previous section, particularly those of Theorem 3.4: is -smooth and -strongly convex, with
and . Although is somewhat complicated, with many saddle points, it satisfies the non-interference assumption because .
Figure 1 visualizes Proposition 3.1 by plotting the approximation error and the theoretical bound at . For this problem, , , and can be found analytically from , where . Figure 4 (left) plots the iterates when optimizing using -RMD and a decaying meta-learning rate . Because varies widely with , we tune to ensure that the first update has norm . In comparison with the true gradient at these points, we see that is indeed a descent direction. Figure 2 (left) visualizes this in a different way, by plotting for various at each point along the trajectory. By Lemma 3.2, this ratio stays well away from zero.
To demonstrate the biased convergence of Theorem 3.3, we break assumption 3 of Theorem 3.4 by changing the upper objective to so that . The guarantee of Lemma 3.2 no longer applies, and we see in Figure 2 (right) that can become negative. Indeed, Figure 3 shows that optimizing with converges to a suboptimal point. However, it also shows that using larger rapidly decreases the bias.
For the original objective , Theorem 3.4 guarantees exact convergence. Figure 4 shows optimization trajectories for various , and a log-scale plot of their convergence rates. Note that, because the lower-level problem cannot be perfectly solved within steps, the optimal is offset from the origin. Truncated back-propagation can handle this, but it breaks the assumptions required by the implicit differentiation approach to bilevel optimization.
2 Hyperparameter optimization problems
We optimize the lower-level problem through steps of gradient descent with and consider how adjusting changes the performance of -RMD. See Appendix G.1 for more experimental setup. Our hypothesis is that -RMD for small works almost as well as full RMD in terms of validation and test accuracy, while requiring less time and far less memory. We also hypothesize that -RMD does almost as well as full RMD in identifying which samples were corrupted . Because our formulation of the problem is unconstrained, the weights are never exactly zero. However, we can calculate an F1 score by setting a threshold on : if , then the hyper-cleaner has marked example as corrupted.F1 scores for other choices of the threshold were very similar. See Appendix G.1 for details.
Table 2 reports these metrics for various . We see that -RMD is somewhat worse than the others, and that validation loss (the outer objective ) decreases with more quickly than generalization error. The F1 score is already maximized at . These preliminary results indicate that in situations with limited memory, -RMD for small (e.g. ) may be a reasonable fallback: it achieves results close to full backprop, and it runs about twice as fast.
From a theoretical optimization perspective, we wonder whether -RMD converges to a stationary point of . Data hypercleaning satisfies all of the assumptions of Theorem 3.4 except that is not full column rank (since ). In particular, the validation loss is deterministic and satisfies . Figure 5 plots the norm of the true gradient on a log scale at the -RMD iterates for various . We see that, despite satisfying almost all assumptions, this problem exhibits biased convergence. The limit of decreases slowly with , but recall from Table 2 that practical metrics improve more quickly.
2.2 Task interaction
We next consider the problem of multitask learning . Similar to , we formulate this as a hyperparameter optimization problem as follows. The lower-level objective learns different linear models with parameter set :
where is the training loss of the multi-class linear logistic regression model, is a regularization constant, and is a nonnegative, symmetric hyperparameter matrix that encodes the similarity between each pair of tasks. After iterations of gradient descent with learning rate , this yields . The upper-level objective estimates the linear regression loss of the learned model on a validation set. Presumably, this will be improved by tuning to reflect the true similarities between the tasks. The tasks that we consider are image recognition trained on very small subsets of the datasets CIFAR- and CIFAR-. See Appendix G.2 for more details.
From an optimization standpoint, we are most interested in the upper-level loss on the validation set, since that is what is directly optimized, and its value is a good indication of the performance of the inexact gradient. Figure 6 plots this learning curve along with two other metrics of theoretical interest: norm of the true gradient, and cosine similarity between the true and approximate gradients. In CIFAR100, the validation error and gradient norm plots show that -RMD converges to an approximate stationary point with a bias that rapidly decreases as increases, agreeing with Proposition 3.1. Also, we find that negative values exist in the cosine similarity of -RMD, which implies that not all the assumptions in Theorem 3.4 hold for this problem (e.g. might not be full rank, or the the inner problem might not be locally strong convex around .) In CIFAR10, some unusal behavior happens. For , the truncated gradient and the full gradient directions eventually become almost the same. We believe this is a very interesting observation but beyond the scope of the paper to explain.
In Table 3, we report the testing accuracy over 10 trials. While in general increasing the number of back-propagation steps improves accuracy, the gaps are small. A thorough investigation of the relationship between convergence and generalization is an interesting open question of both theoretical and practical importance.
3 Meta-learning: One-shot classification
The aim of this experiment is to evaluate the performance of truncated back-propagation in multi-task, stochastic optimization problems. We consider in particular the one-shot classification problem , where each task is a -way classification problem and the goal is learn a hyperparameter such that each task can be solved with few training samples.
In each hyper-iteration, we sample a task, a training set, and a validation set as follows: First, classes are randomly chosen from a pool of classes to define the sampled task . Then the training set is created by randomly drawing one training example from each of the classes. The validation set is constructed similarly, but with more examples from each class. The lower-level objective is
where is the -way cross-entropy loss, and is a deep neural network parametrized by and optionally hyperparameter . To prevent overfitting in the lower-level optimization, we regularize each parameter to be close to center with weight . Both and are hyperparameters, as well as the inner learning rate . The upper-level objective is the loss of the trained network on the sampled validation set . In contrast to other experiments, this is a stochastic optimization problem. Also, depends directly on the hyperparameter , in addition to the indirect dependence through (i.e. ).
We use the Omniglot dataset and a similar neural network as used in with small modifications. Please refer to Appendix G.3 for more details about the model and the data splits. We set and optimize over the hyperparameter . The average accuracy of each model is evaluated over randomly sampled training and validation sets from the meta-testing dataset. For comparison, we also try using full RMD with a very short horizon , which is common in recent work on few-shot learning .
The statistics are shown in Table 4 and the learning curves in Figure 7. In addition to saving memory, all truncated methods are faster than full RMD, sometimes even five times faster. These results suggest that running few-step back-propagation with more hyper-iterations can be more efficient than the full RMD. To support this hypothesis, we also ran -RMD and -RMD for an especially large number of hyper-iterations (k). Even with this many hyper-iterations, the total runtime is less than full RMD with iterations, and the results are significantly improved. We also find that while using a short horizon () is faster, it achieves a lower accuracy at the same number of iterations.
CONCLUSION
We analyze -RMD, a first-order heuristic for solving bilevel optimization problems when the lower-level optimization is itself approximated in an iterative way. We show that -RMD is a valid alternative to full RMD from both theoretical and empirical standpoints. Theoretically, we identify sufficient conditions for which the hyperparameters converge to an approximate or exact stationary point of the upper-level objective. The key observation is that when is near a strict local minimum of the lower-level objective, gradient approximation error decays exponentially with reverse depth. Empirically, we explore the properties of this optimization method with four proof-of-concept experiments. We find that although exact convergence appears to be uncommon in practice, the performance of -RMD is close to full RMD in terms of application-specific metrics (such as generalization error). It is also roughly twice as fast. These results suggest that in hyperparameter optimization or meta learning applications with memory constraints, truncated back-propagation is a reasonable choice.
Our experiments use a modest number of parameters , hyperparameters , and horizon length . This is because we need to be able to calculate both -RMD and full RMD in order to compare their performance. One promising direction for future research is to use -RMD for bilevel optimization problems that require powerful function approximators at both levels of optimization. Truncated RMD makes this approach feasible and enables comparing bilevel optimization to other meta-learning methods on difficult benchmarks.
Appendix
Appendix A Proof of Proposition 3.1
Let . By definition of ,
Therefore, when is locally -strongly convex with respect to in the neighborhood of ,
Suppose is -smooth but nonconvex. In the worst case, if the smallest eigenvalue of is , then for . This gives the bound in (9). However, if is globally strongly convex, then
The bound (10) uses the fact that ∎
Appendix B Proof of Lemma 3.2
To illustrate the idea, here we prove the case where . For , similar steps can be applied. To prove the statement, we first expand the inner product by definition
where we recall as by assumption.
Next we show a technical lemma, which provides a critical tool to bound the second term above; its proof is given in the next section.
Let be -strongly convex and -smooth. Assume and are Lipschitz continuous in , and assume has full column rank. For ,
and is non-singular by assumption,
for some , when is large enough and is small enough. The implication holds because . ∎
Let and be the Lipschitz constant of and . First, we see that the inner product can be lower bounded by the following terms
The above lower bounds can be shown by the following inequalities:
Next we upper bound the error terms: , , and . We will use the fact that gradient descent converges linearly when optimizing a strongly convex and smooth function .
Let be the initial condition. Running gradient descent to optimize an -strongly convex and -smooth function , with step size , generates a sequence satisfying
where and .
Lemma B.2 implies for , .
Now we proceed to bound the errors , , and .
Using the bounds on , , and , we prove the final result.
Appendix C Proof of Theorem 3.3
The proof of this theorem is a standard proof of non-convex optimization with biased gradient estimates. Here we include it for completeness, as part of it will be used later in the proof of Theorem 3.4.
Let be the th iterate. For short hand, we write , and . Assume is -smooth and and almost surely for all . Then by -smoothness, it satisfies
Let be the error in the gradient estimate. Substitute the recursive update to the above inequality. Conditioned on , it satisfies
Performing telescoping sum with the above inequality, we have
Dividing both sides by and using the facts that and that
Appendix D Proof of Theorem 3.4
First we consider the special case when is deterministic. Let . We decompose the full gradients into four parts
We assume that enters a locally strongly convex region for . This implies, by Proposition 3.1, that .
To prove the theorem, we first verify two conditions:
By Lemma 3.2, the assumption , and :
Therefore, for large enough, it holds that
By definition of , it holds that
Let be a lower-bound and -smooth function. Consider the iterative update rule
where satisfies and , for some constant and scalar . Suppose is lower-bounded and is chosen such that . Then .
By telescoping sum, we can show , which implies . ∎
Finally, we prove the main theorem by applying Lemma D.1. Consider a deterministic problem. Take . Because of (15) and (16), by Lemma D.1, it satisfies that
As , it shows converges to zero in the limit.
Appendix E Proof of Theorem 3.5
We prove the non-convergence using the following strategy. First we show that, when assumption 3 in Theorem 3.4, i.e.
does not hold, there is some problem such that for all stationary points (i.e. such that ). Then we show that, for such a problem, optimizing with cannot converge to any of the stationary points.
To construct the counterexample, we consider a scalar deterministic bilevel optimization problem of the form
in which is some perturbation function that we will later define, and is computed by performing steps of gradient descent in the lower-level optimization problem with some constant initial condition and constant step size , i.e.
We can observe this problem satisfies almost all the assumptions in Theorem 3.4:
The lower-level objective is smooth and strongly convex. (Proposition 3.1)
The upper-level objective is smooth. (Theorem 3.3)
The lower-level objective is second-order continuously differentiable (assumption 1 in Theorem 3.4)
The Jacobian if full rank, i.e. (assumption 2 in Theorem 3.4)
The upper-level objective function is deterministic, i.e. (assumption 4 in Theorem 3.4)
But we will show that properly setting can break the non-interfering assumption in (17) (i.e. assumption 3 in Theorem 3.4) and then creates a problem such that optimizing with -RMD does not converge to an exact stationary point.
We follow the two-step strategy mentioned above.
Without loss of generality, let us consider optimizing with -RMD. In this case we can write the approximate and the exact gradients in closed form as
which are given by (5) and (8). We will show that by properly choosing , we can define such that, at any of the stationary points of , the approximate gradient of -RMD does not vanish. That is, we show when , .
Before proceeding, let us define and for convenience. To show how to construct , let us consider the stationary points in the caseNote in this special case, assumption 3 in Theorem 3.4 holds trivially when (i.e. ) and optimizing with -RMD converges to an exact stationary point. when . Let denote the set of these stationary points, i.e. . Since is smooth and lower-bounded, we know that is non-empty, and from the construction of our counterexample we know that contains exactly the s such that .
We use this fact to pick an adversarial . Consider any smooth, lower-bounded whose stationary points are not in , e.g. and . Then has a non-empty set of stationary points such that . We see that, for such , the non-interfering assumption (assumption 3 in Theorem 3.4) is violated in :
And we show for any it holds that . This can be seen from the definition
where the last inequality is because for .
We have shown that there is a problem which satisfies all the assumptions but assumption 3 of Theorem 3.4, and at any of its stationary points (i.e. when ) we have . Now we show this property implies failure to converge to the stationary points for the general problems considered in Theorem 3.5 (i.e. we do not rely on the form made in Step 1 anymore).
We prove this by contradiction. Let be one of the stationary points. We choose such that, for some , for all inside the neighborhood , where we recall is the step size of the lower-level optimization problem. A non-zero exists because is continuous by our assumption and at .
We are ready to show the contradiction. Let . Suppose there is a sequence that converges to the stationary point . This means that there is such that, , , which implies that , . However, by our choice of , , leading to a contradiction.
Thus, no sequence converges to any of the stationary points. This concludes our proof. ∎
Appendix F Proof of Proposition 3.6
Recall our shorthand that and are evaluated at . In the limit, it holds that
To prove the equality (12), we use Lemma (F.1).
For a matrix with , it satisfies that
Since , we have , so . By Lemma F.1,
Appendix G Detailed experimental setup
In this appendix, we provide more details about the settings we used in each experiment. We use Adam to optimize the upper-level objective and vanilla gradient descent for the lower objective. We denote by the results of running steps of gradient descent with step size .
In this appendix, we provide more details about the data hypercleaning experiment on MNIST from Section 4.2.1.
Both the training and the validation sets consist of 5000 class-balanced examples from the MNIST dataset. The test set consists of the remaining examples. For each training example, with probability , we replaced the label with a uniformly random one.
For various , we performed -RMD for 1000 hyperiterations. Like in the toy experiment (Section 4.1) we adjusted the initial meta-learning rate for each so that the norm of the initial update was roughly the same for each .
We asserted earlier that the reported F1 scores are not sensitive to our choice of threshold . To validate this assertion, we repeated the experiment for various thresholds. F1 scores are reported in the table below.
We only ran these experiments for hyperiterations, because the F1 score has essentially converged by that point. Indeed, the plot below shows identification of corrupted labels for , with cutoff . The X axis is in units of 1000 hyperiterations. We see that -RMD rapidly identifies most of the mislabeled examples, with a few false positives.
G.2 Task interaction
We use iterations of gradient descent with learning rate in the lower objective which yields . To ensure that is symmetric, and that and are nonnegative, we re-parametrize them as and , where and is a hyperparameter matrix. Thus, the hyperparameters to be optimized are .
Rather than using raw pixels, we extract image features from the output of the average pooling layer in Resnet- which is trained on ImageNet . We use the same data pre-processing that is used for training Resnet architecture.
When reporting test accuracy, we run 10 independent trials. In each trial, we sample the training and validation datasets with a balanced set of examples each ( for CIFAR-10 and for CIFAR-100) and use the rest of the dataset for testing. To avoid over-fitting, we use early stopping when the testing error does not improve for hyper-iterations.
Although we are using a similar setting as Franceschi et al. , our results on full back-propagation are quite different from theirs. We believe it is because we are using a different network architecture and pre-processing method for feature extraction.
G.3 One-shot classification
The Omniglot dataset , a popular benchmark for few-shot learning, is used in this experiment. We consider -way classification with training and validation examples for each of the five classes. To evaluate the generalization performance, we restrict the meta-training dataset to a random subset of of the Omniglot characters. The meta-validation dataset consists of other characters, and meta-testing dataset has the remaining characters. We use the meta-validation dataset for tuning the upper-level optimization parameters and report the performance of the algorithm on the meta-testing dataset. Note that no data augmentation method is used in the training.
The overall neural network architecture is shown in Figure 8. Our architecture inherits the hyper-representation model of Franceschi et al. with some modifications. The first two convolutional layers, parametrized by hyperparameter , transform the input image into a “hyper-representation” space. The last three layers, parametrized by are fine-tuned in the lower-level optimization. Additionally, we have regularization hyperparameters . The overall setup corresponds essentially to meta-learning the two bottom layers of a CNN; for each task, the weights in the first two layers are frozen, and the -way classifier of the last three layers is fine tuned. Overall, the model has k hyperparameters and k parameters.
We use a meta-batch-size of in each hyper-iteration. To limit the training time, we stop all the algorithms after hyper-iterations. Needless to say, these results could be further improved by using data augmentation, higher meta-batch size, and running more hyper-iterations. However, our current setup is selected so that all the experiments can be run in a reasonable amount of time, while sharing a similar setting used in practical one-shot learning.