Papers › Layer Folding: Neural Network Depth Reduction using Activation Linearization

Layer Folding: Neural Network Depth Reduction using Activation Linearization

17 Jun 2021arXiv:2106.09309archive 2025-07-28

Amir Ben Dror, Niv Zehngut, Avraham Raviv, Evgeny Artyomov, Ran Vitek, Roy Jevnisek

Despite the increasing prevalence of deep neural networks, their applicability in resource-constrained devices is limited due to their computational load. While modern devices exhibit a high level of parallelism, real-time latency is still highly dependent on networks' depth. Although recent works show that below a certain depth, the width of shallower networks must grow exponentially, we presume that neural networks typically exceed this minimal depth to accelerate convergence and incrementally increase accuracy. This motivates us to transform pre-trained deep networks that already exploit such advantages into shallower forms. We propose a method that learns whether non-linear activations can be removed, allowing to fold consecutive linear layers into one. We apply our method to networks pre-trained on CIFAR-10 and CIFAR-100 and find that they can all be transformed into shallower forms that share a similar depth. Finally, we use our method to provide more efficient alternatives to MobileNetV2 and EfficientNet-Lite architectures on the ImageNet classification task.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2106.09309")

Code

Syntology Ran 1 of 12 code samples harvested from 1 repository linked to this paper; 11 have no recorded run. Of those that ran: 1 ran with no contract checked.

By repository: official repository: 12 samples from 1 repository, 1 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

LayerFolding/Layer-Folding officialmentioned in papermentioned on GitHubpytorchBSD-3-Clause report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

12 samples harvested; 1 ran; 0 honoured the contract we drafted; 11 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran
11unverified

Licence: 0 of the 12 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from LayerFolding/Layer-Folding. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

wrapped_partial LayerFolding/Layer-Folding/Folded-Mobilenets/mobilenet_v2.py official repository ran BSD-3-Clause (permissive) · b6e06004f7efe660 · report
bytes_list_feature LayerFolding/Layer-Folding/Folded-Mobilenets/dataset_utils.py official repository unverified BSD-3-Clause (permissive) · ebb225e100d48e3d · report
conv LayerFolding/Layer-Folding/ResNet_Cifar10_postfold.py official repository unverified BSD-3-Clause (permissive) · 9e4ed0ee1e56b044 · report
conv5x5 LayerFolding/Layer-Folding/VGG_Cifar10_postfold.py official repository unverified BSD-3-Clause (permissive) · 09dcc50c884b217d · report
expand_input_by_factor LayerFolding/Layer-Folding/Folded-Mobilenets/conv_blocks.py official repository unverified BSD-3-Clause (permissive) · 2bd76ec2dd72540c · report
float_list_feature LayerFolding/Layer-Folding/Folded-Mobilenets/dataset_utils.py official repository unverified BSD-3-Clause (permissive) · a937f6f8be8fc311 · report
int64_feature LayerFolding/Layer-Folding/Folded-Mobilenets/dataset_utils.py official repository unverified BSD-3-Clause (permissive) · 537870c8bbcd9607 · report
make_layers LayerFolding/Layer-Folding/VGG_Cifar10_postfold.py official repository unverified BSD-3-Clause (permissive) · 718e3968934c45b7 · report
preprocess_image LayerFolding/Layer-Folding/Folded-Mobilenets/preprocessing.py official repository unverified BSD-3-Clause (permissive) · 3ef89f5a98a3352d · report
vgg16 LayerFolding/Layer-Folding/VGG_Cifar10_prefold.py official repository unverified BSD-3-Clause (permissive) · 58bbc7ac2c2a5474 · report
vgg19 LayerFolding/Layer-Folding/VGG_Cifar10_postfold.py official repository unverified BSD-3-Clause (permissive) · 1ad77b38966daedd · report
vgg19 LayerFolding/Layer-Folding/VGG_Cifar10_prefold.py official repository unverified BSD-3-Clause (permissive) · 50714c640ea17fb6 · report

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

1x1 ConvolutionAverage PoolingBatch NormalizationConvolutionDepthwise ConvolutionDepthwise Separable ConvolutionInverted Residual BlockPointwise Convolution

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections