Neural Architecture Search (NAS)
Neural Architecture Search
- Estimated duration
- 35 minutes
- Related questions
- 5
- Related algorithms
- 4
- Status
- Log in to track
Lesson objectives
- Understand the three components of NAS.
- Know the role of evolutionary algorithms in NAS.
- Estimate the computational cost and ways to reduce it.
Explanation
Instead of designing the network architecture by hand, NAS searches for it automatically. Evolutionary algorithms were among the first methods used for this.
Components: the search space (chain-structured layers, repeatable cells, or multi-branch graphs), the search strategy (random, evolutionary, reinforcement learning, gradient-based such as DARTS), and the performance estimation strategy (full training, short training, weight sharing, or performance predictors).
In evolutionary NAS, an individual is encoded as a list of layers or a cell graph, and mutations add a layer, remove one or change its type. The best-known examples are the works that used aging in selection (Regularized Evolution).
Cost: every evaluation trains a network, so smaller data, fewer epochs and ready-made benchmarks such as NAS-Bench, which provide precomputed results, are used.
Mathematics
Multi-objective
\min_{a\in\mathcal{A}}\left(\text{err}_{val}(a),\ \text{FLOPs}(a)\right)Python code
import random
random.seed(0)
LAYERS = ['conv3', 'conv5', 'pool', 'skip']
def mutate(arch):
a = list(arch); i = random.randrange(len(a))
a[i] = random.choice(LAYERS)
return a
print(mutate(['conv3', 'pool', 'conv3']))Simplified teaching code that works with NumPy only; for research experiments use a documented library and fix the random seed.
Practical exercise
In the Neural Networks Lab (simplified NAS mode) the lab searches for the number of layers and units of a small MLP that is actually trained in the browser.
Common mistakes
- Comparing architectures with short training and then reporting full-training results without re-evaluation.
- Ignoring the cost of the search itself (GPU hours).
Summary
NAS = space + search strategy + performance estimation; cost is the biggest challenge.
References
There are no references recorded for this lesson.
Short quiz
5 questions are chosen at random from 5 questions linked to this lesson, and the quiz is graded on the server.
Links within the lab
- Algorithms
- Models
- Optimization types
- Related lessons
- In the paths
