相关推荐
Qwen2.5-7B大模型实战:从零部署到高效推理全流程解析
本文详细解析了Qwen2.5-7B大模型从零部署到高效推理的全流程。内容涵盖环境准备、模型下载、使用Transformers进行核心对话推理,并深入介绍了vLLM与TGI生产级服务部署、GPTQ/AWQ量化技术以降低显存消耗,以及llama.cpp、Ollama等本地推理方案。旨在帮助开发者快速掌握部署技巧,实现大模型在消费级硬件上的高效运行。
lua学习笔记day05-----协同程序过滤器
协同函数
继电器的选型规范
触点是继电器中最重要的结构件,触点的使用寿命受触点材料、触点上的电压及电流值(特别是接通时及断开时的电压、电流波形)、负载种类、切换频率、环境情况、接触形式、触点回跳现象等的影响,触点失效多以触点的材料转移、粘连、异常消耗、接触电阻增大等故障现象出现,使用时需要注意。为了稳定工作, DC 型继电器的线圈两端所加电压推荐使用波纹变化率小于±5%的线圈额定电压,否则继电器会工作不稳定,引起触点的粘接或异常损耗,特别是在继电器的驱动电路上连接有电动机、螺线管、变压器等器件时,这种情况更为明显。
lua协同程序实现管道过滤器
--消费者驱动,协同程序实现管道过滤器 function receive(prod)--启动协程,获取返回值 local status,value=coroutine.resume(prod) return value end function send(x)--返回新值并挂起 coroutine.yield(x) end function producer()--创建协程返回读取的值
手把手推导APM的 sqrt_controller控制器
前言 玩过无人机的朋友对APM应该都不会陌生,如果是搞过多旋翼飞控且读过代码,肯定遇到过sqrt_controller控制器,它频繁的在位置、姿态控制中出现,所以非常有必要搞清楚这个控制原理。 下面以高度控制器为例来分析。 高度控制 APM的高度控制采用PID串级3环控制,即外环位置控制,中间速度控制,内环速度控制,如下图所示。 今天要讨论的sqrt_controller就是应用于位置控制器中。位置控制器的输出是速度控制器的参考reference输入,如果采用单P控制,其输出vel_ref = pos_e
基于PLC的矿用排水控制系统设计【附代码】
(3)矿用排水控制系统的软件设计 研究设计了矿用排水控制系统的软件,包括PLC程序的编写和上位机监控画面的设计。(2)矿用排水控制系统的硬件设计 研究对矿用排水控制系统的硬件进行了选型和设计,包括矿用多级耐磨离心泵、三相异步防爆电机等执行设备的选型,以及控制系统所需用到的各类型传感器、PLC的I/O点分配及选型。(1)矿用排水控制系统的现状分析 研究首先对矿井排水系统的现状进行了分析,指出了现有系统存在的问题,如自动化程度低、劳动强度大、设备维护困难等。✅ 具体问题可以私信或查看文章底部二维码。
Lua协同程序
协同程序 协同程序(coroutine)与多线程情况下的线程比较类似:有自己的堆栈,自己的局部变量,有自己的指令指针,但是和其他协同程序共享全局变量等很多信息。线程和协同程序的主要不同在于:在多处理器情况下,从概念上来讲多线程程序同时运行多个线程;而协同程序是通过协作来完成,在任一指定时刻只有一个协同程序在运行,并且这个正在运行的协同程序只有在明确的被要求挂起的时候才会被挂起。 协同是非常强大的功...
HFSS实战项目——微带带通滤波器设计
本文详细介绍并设计了一款微带带通滤波器,通过HFSS三位电磁仿真软件对其进行仿真设计及优化,仿真结果表明,本文设计的滤波器表现出优良的滤波性能,符合设计要求。
Lua基础:协同程序
协同程序是通过协作来完成,在任一指定时刻只有一个协同程序在运行,协同有三个状态:挂起态、运行态、停止态。 co=coroutine.create( --coroutine协同,create创建协同程序。 function() --匿名函数 --print("hi") for ...
【深度学习新浪潮】什么是system 1和system 2?
System 1(快速生成)指大模型直接基于输入生成响应,无需显式中间推理步骤。例如,GPT-4等模型在默认状态下通过Transformer直接输出结果,擅长快速回答简单问题或生成连贯文本,但在复杂逻辑任务中可能出错。这类模型的内部计算以向量形式隐式进行,难以处理符号推理等需要离散决策的任务。System 2(慢速推理)指模型通过生成中间token(如思维链、分步推导)或多次调用LLM进行复杂推理。
ZYNQ系列PS侧和PL侧DDR3或DDR4在AD(Altium Designer 25)中的layout布线规则约束
DDR3或DDR4的PCB布线规则通常有相对固定的要求,对应的,在PCB设计时有固定的约束设置。
Lua 学习笔记(九)协同程序(线程thread)
协同程序与线程thread差不多,也就是一条执行序列,拥有自己独立的栈、局部变量和命令指针,同时又与其他协同程序共享全局变量和其他大部分东西。从概念上讲线程与协同程序的主要区别在于,一个具有多个线程的程序可以同时运行几个线程,而协同程序却需要彼此协作的运行。也就是说多个协同程序在任意时刻只能运行一个协同程序,只有当正在运行的协同程序显式的要求挂起时,它的执行才会暂停。 一、协同程...
Lammps实现Ar的沸腾过程(包含in文件)
Lammps实现简单的沸腾过程
Lua过滤器协同
这篇文章主要介绍了Lua中的协同程序探究,本文讲解了什么是协同程序、创建协同程序、更像样的协同程序、让协同程序挂起、resume操作的返回值,需要的朋友可以参考下。
老版QQ原生表情gif动态
这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。
深度学习工具包 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');```[](https://bitdeli.com/free "Bitdeli Badge")
1-9、Lua协同程序
1-9、Lua协同程序 文章目录1-9、Lua协同程序1、协同的基础2、管道和过滤器3、用作迭代器的协同4、非抢占式多线程 协同程序(coroutine)与多线程情况下的线程比较类似:有自己的堆栈,自己的局部变量,有自己的指令指针(IP,instruction pointer),但与其它协同程序共享全局变量等很多信息。线程和协同程序的主要不同在于:在多处理器情况下,从概念上来讲多线程程序同时运行...
SAP B1中文培訓教材_SDK
公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说
Lua—第9章协同程序
协同程序(coroutine)与多线程情况下的线程比较类似:有自己的堆栈,自己的局部变量,有自己的指令指针,但是和其他协同程序共享全局变量等很多信息。线程和协同程序的主要不同在于:在多处理器情况下,从概念上来讲多线程程序同时运行多个线 程;而协同程序是通过协作来完成,在任一指定时刻只有一个协同程序在运行,并且这个正在运行的协同程序只有在明确的被要求挂起的时候
NTscan扫描工具
ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。
Lua学习笔记13:管道和过滤器
一个关于协同程序的经典示例是“生产者-消费者”问题。这其中涉及到两个函数,一个函数不断地产生值(比如从一个文件中读取值),另一个则不断地消费这些值(比如将这些值写到另一个文件)。通常,这两个函数大致是这样的: function producer () while true do local x = io.read() -- 产生新的值 send(x)...
chapter9_2 管道与过滤器
一个关于协同程序的经典示例就是“生产者-消费者”的问题。 一个不断产生值,一个不断消费这些值。比如: function producer() while true do local x = io.read() --produce new value send(x) --...
Lua管道和过滤器
管道和过滤器 协同最有代表性的作用是用来描述生产者-消费者问题。我们假定有一个函数在不断的生产值(比如从文件中读取),另一个函数不断的消费这些值(比如写到另一文件中),这两个函数如下: function producer () while true do local x = io.read() -- produce new value send(x) -- send to consumer...
《Lua程序设计[第二版]》第9,10章笔记
第9章 协同程序(coroutine) 协同程序与线程(thread)差不多,也就是一条执行序列,拥有自己独立的栈、局部变量和指令指针,同时又与其他协同程序共享全局变量和其他大部分东西。主要区别:一个具有多个线程的程序可以同时运行多个线程,而协同程序却需要彼此协作地运行。就是说一个具有多个协同程序的程序在任意时刻只能运行一个协同程序,并且正在运行的协同程序只会在其显示的地要求挂起(suspe
Lua 学习笔记(七) —— 协同程序(二)
昨天学习了协同程序,今天继续看看协同函数。 既然说到了协同程序和线程有些类似,那一定记得学习线程时的“生产者和消费者”的问题了。不知道线程?没关系。所谓“生产者和消费者”是指一个函数不断地产生值,另一个函数不断地接收值。比如,一个函数从一个文件中读值,另一个函数则接收值写入文件中,下面就是这个例子。 那么send和receive函数是怎么交流的呢?记住,一个具有多个协同程序的程序在任意
第9章 Lua协同程序深度解析:从基础到多线程编程实战
Lua协同程序摘要 Lua协同程序(coroutine)是一种轻量级并发编程特性,支持在单线程内实现多个执行流的协作式切换。与多线程不同,协同程序采用非抢先式调度,通过显式控制执行权转移避免竞态条件。核心操作包括: 创建(coroutine.create) 启动/恢复(coroutine.resume) 挂起(coroutine.yield) 状态查询(coroutine.status) 协同程序可维护内部状态,适合状态机、迭代器、数据分批处理等场景。相比函数调用,协同程序支持对称执行权转移,能多次挂起恢复
《Lua程序设计》9.2 管道(pipe)与过滤器(filter) 包含使用协同函数实现“生产者——消费者”问题的实例代码...
一个关于协同程序的经典示例是“生产者-消费者”问题。这其中涉及到两个函数,一个函数不断地产生值(比如从一个文件中读取值),另一个则不断地消费这些值(比如将这些值写到另一个文件)。通常,这两个函数大致是这样的: function producer () while true do local x = io.read() -- 产生新的值 s...
Lua学习笔记 第九章 协同程序 —— coroutine
协同程序与线程差不多,拥有自己独立的栈、局部变量和指令指针,同时又与其它协同程序共享全局变量和其它大部分东西。线程与协同程序的主要区别: 一个具有多个线程的程序可以同时运行几个线程;而一个具有多个协同程序的程序在任意时刻只能运行一个协同程序,并且正在运行的协同程序只会在其显示地要求挂起时,它的执行才会暂停。 9.1 协同程序基础 Lua将所有协同程序的函数放置在一个名为"corouti
第九章 协同程序(coroutine)
2021年3月15日17:40:39占位
502



被折叠的 条评论
为什么被折叠?



