Worked examples — DenseNet and EfficientNet
This page is a calculator you can trust. The parent note gave you the formulas; here we run them through every kind of input — small blocks, big blocks, compression that rounds down, the degenerate "no bottleneck" case, exponential scaling that blows up, and the exam-twist where a number is hidden. Before touching a single example, let us list every situation these formulas can face.
The scenario matrix
Every problem in this topic is one of the cells below. If you can do all of them, nothing on an exam can surprise you.
| Cell | Case class | What makes it tricky |
|---|---|---|
| A | DenseNet channel counting, plain | Running concatenation total |
| B | Transition compression with clean division | is a whole number |
| C | Transition compression that rounds down | — the floor bites |
| D | Bottleneck vs. no-bottleneck parameter count | when does beat ? (degenerate small- edge) |
| E | Full network trace (multi-block, DenseNet-121 style) | chaining A+B across 4 blocks |
| F | EfficientNet constraint check () | verifying a candidate triple |
| G | EfficientNet compound scaling at a given | exponential growth , resolution rounding |
| H | Limiting / degenerate scaling (, one dimension only) | what "no scaling" and "unbalanced scaling" cost |
| I | Word problem (memory / FLOP budget) | real-world units, choosing a config |
| J | Exam twist (solve backwards for a hidden or ) | invert the formula |
Recall What does concatenation do to channel count that addition does not?
Concatenation ::: stacks channels, so counts add up (); ResNet addition keeps the channel count fixed.
Below, ten worked examples cover cells A–J. Each cell is labelled.
Example 1 — Cell A: plain channel counting
Forecast: guess the final number before reading. (Add four times to 16 — hold that thought.)
- Layer 1 sees , outputs new → running total . Why this step? Each produces exactly feature maps; concatenation appends them.
- Layer 2 sees 24, outputs 8 → . Why this step? Its input is everything so far — the concatenation .
- Layer 3 sees 32 → .
- Layer 4 sees 40 → .
Answer: output channels.
Verify: closed form . ✓ The step-by-step and the formula agree.
Example 2 — Cell B: compression, clean division
Forecast: half of 48 — will the floor matter here?
- Apply with , → . Why this step? The transition's conv projects channels down to to keep growth in check.
Answer: 24 channels.
Verify: exactly — no rounding needed. Units: channels → channels. ✓
Example 3 — Cell C: compression that rounds down
Forecast: — you cannot have half a channel. What happens?
- Compute . Why this step? Raw product first, then floor — order matters.
- Apply the floor: . Why this step? Channel count must be a whole number; DenseNet uses (round down), never round-to-nearest.
Answer: 22 channels (not 23!).
Verify: . ✓
Example 4 — Cell D: bottleneck vs. no-bottleneck (degenerate small-)
Forecast: bottlenecks are famous for saving parameters — do they always?
Recall the two costs from the parent:
- With bottleneck: (the ) (the on channels).
- Without bottleneck: (a plain ).
- Late block, , :
- With: .
- Without: . Why this step? Plug into both formulas and compare totals. → Bottleneck saves parameters. Worth it.
- Early degenerate, , :
- With: .
- Without: . Why this step? Same formulas, tiny . Now the fixed term dominates. → Bottleneck is worse by params.
Answer: bottlenecks help when is large (deep in a block); at tiny the constant overhead makes them lose.
Verify: solve the break-even . For , . So above channels the bottleneck wins — consistent with "worse at 12, better at 300." ✓
Example 5 — Cell E: full DenseNet-121-style trace
Forecast: the parent quotes 256 → 128 → 512 → 256 → 1024 → 512 → 1024. Reproduce it.
- Block 1 out: . Why? Cell-A formula with .
- Transition 1: . Why? Cell-B compression.
- Block 2 out: .
- Transition 2: .
- Block 3 out: .
- Transition 3: .
- Block 4 out: (no transition follows → global average pool). Why this step for each? Alternate Cell A (block) and Cell B (transition) down the chain.
Answer: .
Verify: every arrow matches the parent's DenseNet-121 table. ✓
Example 6 — Cell F: EfficientNet constraint check
Forecast: the whole point is FLOPs doubling per -step — is this triple close to 2?
- Compute . Why? Width appears squared in FLOPs (input × output channels).
- Compute . Why? Resolution squared (spatial ).
- Multiply: . Why this step? This is — the per- FLOP multiplier.
Answer: , which rounds to within the "" tolerance. ✓ Valid.
Verify: , and . ✓
Example 7 — Cell G: compound scaling at (B7)
Forecast: exponentials at — expect roughly depth.
- Depth . Why? Depth scales as by definition of compound scaling. .
- Width . Why? Width scales as .
- Resolution . , so . Why this step? Resolution scales as off the 224 baseline.
Answer: depth , width , resolution px.
Verify: , , . ✓
Example 8 — Cell H: limiting / degenerate scaling
Forecast: should mean "do nothing." And pouring all budget into depth should waste it.
- : , , . Why? Anything to the power 0 is 1 — this is the B0 baseline, no scaling.
- Depth-only : FLOPs . Cost = 2× FLOPs. Why this step? Depth is linear in FLOPs.
- Balanced FLOPs (i.e. ): by construction FLOPs too — same cost, but spread across three dimensions. Why this step? The constraint was designed so one -step = 2× FLOPs.
Answer: (a) → the untouched baseline. (b) Both spend 2× FLOPs, but balanced scaling empirically gives higher accuracy — same budget, better spent. The degenerate depth-only choice is legal but suboptimal.
Verify: ; and , matching the depth-only 2×. ✓
Example 9 — Cell I: word / budget problem (with figure)
Forecast: solve for the biggest whole .
- Set inequality: . Why this step? Output channels grow as ; the cap is a hard memory limit.
- Solve: . Why this step? Isolate .
- Floor to whole layers: (since gives ). Why this step? You cannot have a fractional layer, and 5 overshoots.
- Actual output: channels. Compress: .
Answer: , block output , post-transition channels.

The figure shows the running channel total climbing by each layer (burnt-orange steps), the plum ceiling at 100, and the teal drop to 44 after compression.
Verify: gives (rejected); gives (accepted); . ✓
Example 10 — Cell J: exam twist (solve backwards)
Forecast: invert each formula instead of plugging forward.
- Channel inversion: . Why this step? The output formula is linear in ; algebra recovers it.
- Scaling inversion: with . Take logs: . Why this step? is the exponent; the logarithm is the tool that "undoes" an exponent (it answers "what power gives this value?", exactly like arctan undoes tan).
- Evaluate: , , ratio . Why this step? , so cleanly.
Answer: , and .
Verify: forward-check both: ✓; ✓.
Recall Why is the logarithm the right tool to recover
from ? Because ::: sits in the exponent, and is the exact inverse of exponentiation — it asks "which power produced this number?"
Connections
- Prerequisite for the concatenation-vs-addition contrast: 3.4.7-ResNet-and-Skip-Connections
- MBConv depthwise blocks used by EfficientNet: 3.4.9-MobileNet-and-Depthwise-Separable-Convolutions
- Where come from: 3.4.11-Neural-Architecture-Search
- Bottleneck & heritage: 3.4.8-Inception-and-GoogLeNet
- The BN in every : 3.4.3-Batch-Normalization-and-Regularization
- Shrinking these models further: 4.2.5-Model-Compression-and-Pruning