让神经网络自动适应不同大小,无需重新训练
Neural Metamorphosis
- 用隐式函数建模权重连续空间,直接生成任意尺寸网络参数
- 在图像分类等任务中,压缩75%仍保持全尺寸性能
- 通过路径优化和输入加噪提升权重平滑性,支持未见配置
本文提出一种名为神经变体(Neural Metamorphosis, NeuMeta)的新学习范式,旨在构建可自我变形的神经网络。与为不同架构或规模分别设计模型不同,NeuMeta 直接学习神经网络的连续权重流形。训练完成后,可直接从该流形采样生成任意尺寸网络的权重,包括此前未见过的配置,无需重新训练。为此,NeuMeta 使用隐式函数作为超网络,以模型空间坐标为输入,生成流形上的对应权重值。训练过程中发现,最终性能与所学流形的平滑度密切相关。为提升平滑性,采用两种策略:首先通过排列权重矩阵解决最短哈密顿路径问题,实现模型内平滑;其次在训练隐式函数时对输入坐标添加噪声,确保不同尺寸模型输出一致。大量实验表明,NeuMeta 在图像分类、语义分割和图像生成任务中均表现优异,在75%压缩率下仍保持全尺寸性能。
原文摘要 · Abstract (English)
This paper introduces a new learning paradigm termed Neural Metamorphosis (NeuMeta), which aims to build self-morphable neural networks. Contrary to crafting separate models for different architectures or sizes, NeuMeta directly learns the continuous weight manifold of neural networks. Once trained, we can sample weights for any-sized network directly from the manifold, even for previously unseen configurations, without retraining. To achieve this ambitious goal, NeuMeta trains neural implicit functions as hypernetworks. They accept coordinates within the model space as input, and generate corresponding weight values on the manifold. In other words, the implicit function is learned in a way, that the predicted weights is well-performed across various models sizes. In training those models, we notice that, the final performance closely relates on smoothness of the learned manifold. In pursuit of enhancing this smoothness, we employ two strategies. First, we permute weight matrices to achieve intra-model smoothness, by solving the Shortest Hamiltonian Path problem. Besides, we add a noise on the input coordinates when training the implicit function, ensuring models with various sizes shows consistent outputs. As such, NeuMeta shows promising results in synthesizing parameters for various network configurations. Our extensive tests in image classification, semantic segmentation, and image generation reveal that NeuMeta sustains full-size performance even at a 75% compression rate.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。