Model Stock: All we need is just a few fine-tuned models

文章主要内容和创新点

主要内容

本文提出了一种名为Model Stock的高效微调方法,用于大型预训练模型的优化。该方法旨在解决传统模型融合方法(如Model Soup)需要大量微调模型(数十个)才能达到良好性能的问题,仅通过少量微调模型(甚至2个)即可实现更优的分布内(ID)和分布外(OOD)性能。

核心研究发现包括:

  1. 不同随机种子微调的模型权重在权重空间中呈现“薄壳分布”,层间的角度和范数具有高度一致性;
  2. 模型性能与靠近权重空间中心的程度正相关,越接近中心,ID和OOD任务表现越好;
  3. 基于上述几何特性,Model Stock以预训练模型为“锚点”,通过几何计算从少量微调模型中逼近权重中心,无需额外训练即可确定最优插值比例,大幅降低计算成本。

实验表明,基于CLIP架构的Model Stock在标准基准测试中,ID和OOD性能均优于Model Soup等现有方法,且计算成本仅为其1/24至1/35。

创新点
  1. 权重空间几何特性的发现:首次揭示微调模型权重在层间呈现角度和范数的一致性,分布于“薄壳”上,且靠近中心的权重性能更优;
  2. 高效模型融合方法:提出Model Stock,仅需2个微调模型和预训练模型,通过几何推导(垂直投影计算)即可逼近权重中心,无需大量模型平均;
  3. 灵活性与效率:支持训练中或训练后融合
【Davinci开发】:CS接口创建及连接 AUTOSAR SWC之间添加CS-port :详细讲解step 阅读详情

相关推荐

手把手教你用Simulink搭建交流异步电机矢量控制模型(附完整仿真文件)

本文提供了一份详细的Simulink仿真指南,手把手教你从零开始搭建交流异步电机矢量控制模型。内容涵盖主电路搭建、坐标变换实现、双闭环PI调节器设计、转子磁链观测器调试等核心步骤,并附有完整的仿真文件,帮助读者跨越理论到实践的鸿沟,掌握高性能电机控制系统的建模与仿真技能。

pz890123的博客 679

STM32驱动AD2S1210实现旋变解码与角度读取

旋转变压器作为一种耐高温、抗振动的角度传感器,在工业伺服、机器人关节和电动汽车电驱等场景中占据重要地位。其输出信号需要经过专用转换芯片处理才能被MCU高效使用。AD2S1210是一款典型的旋变数字转换器(RDC),内部采用Type II型跟踪环,将模拟SIN/COS信号实时解算为数字角度与速度,降低了处理器负担并提升抗干扰能力。本文基于STM32平台,详细介绍了AD2S1210的硬件接线、SPI通信配置、寄存器初始化流程,以及读取位置数据时的SAMPLE脉冲时序等关键实现。同时总结了常见故障如全FF、角度跳

weixin_34194829的博客 201

简单易懂的AXI_Lite 总线详解

简单易懂的AXI_Lite 总线详解 1、前言 AXI_LITE协议主要应用于Xilinx的ZYNQ芯片构架下的ARM和FPGA之间的数据读写,更偏向于单个寄存器的读写。 2、AXI总线与ZYNQ的关系 AXI(Advanced eXtensible Interface)本是由ARM公司提出的一种总线协议,Xilinx从6系列的FPGA开始对AXI总线提供支持,此时AXI已经发展到了AXI4这个版本,所以当你用到Xilinx的软件的时候看到的都是“AIX4”的IP,如Vivado打包一个AXI IP的时候,

m0_46642108的博客 8504

【Python3教程】Python3高级篇之uWSGI 安装配置

本文介绍了在Python 3环境中安装和配置uWSGI的完整流程,涵盖基本安装、Flask/Django应用部署、Nginx集成以及systemd管理等关键环节。主要内容包括:uWSGI的安装前提条件,创建简单WSGI应用,编写uWSGI配置文件(.ini格式),与Nginx配合实现生产环境部署,以及使用systemd实现服务管理。文章还提供了常见Web框架(Flask、Django)的部署示例和高级配置建议,如负载均衡、HTTPS设置等。最后列出了权限、端口占用等常见问题的解决方案,为开发者提供了一套完整

No8g攻城狮的博客 445

统信UOS丨开机无法进入系统 无法打开控制台访问权限,root账号被锁定(cannot open access to console, the root account is locked)

步骤四:分别打开文件发现Roota下的fstab就是我们要找的文件,打开查看Roota的属性发现其为挂载的磁盘nvme0n1p3。步骤三:按Win+E打开文件管理器在分区中查找/etc/fstab文件,发现Roota和Rootb下都有该文件。步骤二:按键盘Ctrl+Alt+F4,进入终端控制台,如下图所示输入startx回车,进入桌面。步骤一:找到UOS系统安装的U盘,选择U盘启动进入安装界面,如下图所示。步骤七:关机,拔出U盘,启动电脑,OK,问题解决。

Reyn_观极 1万+

使用 Simulink 进行电力电子系统的小信号模型仿真

电力电子系统(Power Electronics System)包括各种功率转换器(如 DC-DC 转换器、逆变器等)。这些设备中的关键组件(如 MOSFET、IGBT、电容器、电感器等)不仅影响系统的性能,还直接关系到系统的稳定性、效率和可靠性。因此,在设计阶段进行详细的建模和仿真至关重要。小信号模型仿真的目的是通过线性化非线性系统来评估其动态特性,包括增益、相位裕度、带宽等指标。通过本教程,我们介绍了如何使用 Simulink 进行电力电子系统的小信号模型仿真。背景介绍。

xiaoheshang_123的博客 483

组合导航 | RTK、IMU与激光雷达组合导航算法:原理、实现与验证

当激光雷达噪声增加至0.1m时,系统位置RMSE仅上升18%,验证了滤波算法的鲁棒性[110]:融合方案在RTK信号丢失30秒后,位置误差仍控制在1.5m内,显著优于IMU单独导航[28]:ESKF框架能有效建模传感器误差特性,状态向量需包含外参与时间偏移等关键参数。:传感器标定精度直接影响系统性能,建议每3个月进行一次重新标定。:IMU预积分与特征匹配是系统实时性的关键瓶颈,需重点优化。:维持10秒窗口内的关键帧,平衡精度与实时性[132]:特征匹配占总耗时的65%,可通过。

尘世冰封的专栏 959

【UML】-- 期末试题题库含答案(各章题目、选择题、填空题、简答题、画图题)

每章都有对应的题目和答案,选择题,填空简答,大题,答案已标红,方便大家观看

个人博客 1万+

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

上一篇: 2024 NASA SUITS Report: LLM-Driven Immersive Augmented Reality User Interface for Robotics and Space
下一篇: Is Chain-of-Thought Reasoning of LLMs a Mirage? A Data Distribution Lens
UnknownBody
博客等级 码龄16年 5602粉丝 4816原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

UnknownBody

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址