【cpufreq】arm架构计算计算每个频点的使用率

Android功耗系列专题理论之三:cpu 功耗问题分析方法 摘要:本文系统讲解了CPU电源管理与功耗优化方法,包括频点调节、大小核调度、cpuidle和负载优化等技术。详细分析了Linux内核中的cpufreq框架、schedutil调节器工作原理,以及高通/MTK平台的提频机制。提供了通过sysfs接口调整参数、使用工具监控CPU状态、分析非持续性负载问题等实用方法,帮助开发者平衡性能与功耗。文章还介绍了大小核调度策略、C-state优化等进阶内容,并给出具体命令示例和调试技巧。 阅读详情

主要参考这篇内核文档:https://www.kernel.org/doc/Documentation/cpu-freq/cpufreq-stats.txt

     CPU frequency and voltage scaling statistics in the Linux(TM) kernel


             L i n u x    c p u f r e q - s t a t s   d r i v e r

                       - information for users -


             Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>

Contents
1. Introduction
2. Statistics Provided (with example)
3. Configuring cpufreq-stats


1. Introduction

cpufreq-stats is a driver that provides CPU frequency statistics for each CPU.
These statistics are provided in /sysfs as a bunch of read_only interfaces. This
interface (when configured) will appear in a separate directory under cpufreq
in /sysfs (<sysfs root>/devices/system/cpu/cpuX/cpufreq/stats/) for each CPU.
Various statistics will form read_only files under this directory.

This driver is designed to be independent of any particular cpufreq_driver
that may be running on your CPU. So, it will work with any cpufreq_driver.


2. Statistics Provided (with example)

cpufreq stats provides following statistics (explained in detail below).
-  time_in_state
-  total_trans
-  trans_table

All the statistics will be from the time the stats driver has been inserted
(or the time the stats were reset) to the time when a read of a particular
statistic is done. Obviously, stats driver will not have any information
about the frequency transitions before the stats driver insertion.

--------------------------------------------------------------------------------
<mysystem>:/sys/devices/system/cpu/cpu0/cpufreq/stats # ls -l
total 0
drwxr-xr-x  2 root root    0 May 14 16:06 .
drwxr-xr-x  3 root root    0 May 14 15:58 ..
--w-------  1 root root 4096 May 14 16:06 reset
-r--r--r--  1 root root 4096 May 14 16:06 time_in_state
-r--r--r--  1 root root 4096 May 14 16:06 total_trans
-r--r--r--  1 root root 4096 May 14 16:06 trans_table
--------------------------------------------------------------------------------

-  reset
Write-only attribute that can be used to reset the stat counters. This can be
useful for evaluating system behaviour under different governors without the
need for a reboot.

-  time_in_state
This gives the amount of time spent in each of the frequencies supported by
this CPU. The cat output will have "<frequency> <time>" pair in each line, which
will mean this CPU spent <time> usertime units of time at <frequency>. Output
will have one line for each of the supported frequencies. usertime units here 
is 10mS (similar to other time exported in /proc).

--------------------------------------------------------------------------------
<mysystem>:/sys/devices/system/cpu/cpu0/cpufreq/stats # cat time_in_state 
3600000 2089
3400000 136
3200000 34
3000000 67
2800000 172488
--------------------------------------------------------------------------------


-  total_trans
This gives the total number of frequency transitions on this CPU. The cat 
output will have a single count which is the total number of frequency
transitions.

--------------------------------------------------------------------------------
<mysystem>:/sys/devices/system/cpu/cpu0/cpufreq/stats # cat total_trans
20
--------------------------------------------------------------------------------

-  trans_table
This will give a fine grained information about all the CPU frequency
transitions. The cat output here is a two dimensional matrix(二维矩阵), where an entry
<i,j> (row i, column j) represents the count of number of transitions from 
Freq_i to Freq_j. Freq_i is in descending order with increasing rows and 
Freq_j is in descending order with increasing columns. The output here also 
contains the actual freq values for each row and column for better readability.

If the transition table is bigger than PAGE_SIZE, reading this will
return an -EFBIG error.

--------------------------------------------------------------------------------
<mysystem>:/sys/devices/system/cpu/cpu0/cpufreq/stats # cat trans_table
   From  :    To
         :   3600000   3400000   3200000   3000000   2800000 
  3600000:         0         5         0         0         0 
  3400000:         4         0         2         0         0 
  3200000:         0         1         0         2         0 
  3000000:         0         0         1         0         3 
  2800000:         0         0         0         2         0 
--------------------------------------------------------------------------------


3. Configuring cpufreq-stats

To configure cpufreq-stats in your kernel
Config Main Menu
	Power management options (ACPI, APM)  --->
		CPU Frequency scaling  --->
			[*] CPU Frequency scaling
			[*]   CPU frequency translation statistics


"CPU Frequency scaling" (CONFIG_CPU_FREQ) should be enabled to configure
cpufreq-stats.

"CPU frequency translation statistics" (CONFIG_CPU_FREQ_STAT) provides the
statistics which includes time_in_state, total_trans and trans_table.

Once this option is enabled and your CPU supports cpufrequency, you
will be able to see the CPU frequency statistics in /sysfs.

基于这个就可以计算出每个频点的使用率,这是一个很简单的脚本。使用率包含了每个频点在p_state和c_state两个状态的值。

大致算法如下:

前后两次cat time_in_state的差的和做分母,每个的差作为分子

#!/usr/bin/bash
DEBUG=0
function cal_time_in_state {
	local time=2
	local cpu_dir="/sdcard/result/cpu/"
	if [ -e $cpu_dir ] ; then
		rm -rf $cpu_dir
	else
		mkdir $cpu_dir
	fi
	mkdir $cpu_dir

	cat /sys/devices/system/cpu/${1}/cpufreq/stats/time_in_state > ${cpu_dir}${1}_time_state_start.txt
	sleep ${time}
	cat /sys/devices/system/cpu/${1}/cpufreq/stats/time_in_state > ${cpu_dir}${1}_time_state_end.txt
	busybox awk 'NR==FNR{a[i]=$2; i++} 
				NR>FNR{sum+=$2-a[j]; b[j]=$2-a[j]; j++;}
				END{printf("module0_state: "); while (k<j){printf("%-8.2f", b[k]/sum);k++}; printf("\n")}
				' ${cpu_dir}${1}_time_state_start.txt ${cpu_dir}${1}_time_state_end.txt
	if [ "$DEBUG" = "0" ] ; then
		rm ${cpu_dir}${1}_time_state_start.txt ${cpu_dir}${1}_time_state_end.txt
	fi
}

cal_time_in_state cpu0
cal_time_in_state cpu4
【信息科学与工程学】【控制科学】第十二篇 微型计算机控制技术01 更精确的经典模型:I1在第5周期WB结束,I2最早可在第6周期进入EX,但I2在ID阶段就需要R1,因此I2的ID需在第6周期,而I1的WB在第5周期,所以I2的ID可以紧接在第6周期,但中间仍有一个stall(因为I1的EX结果要等到MEM之后才能转发给ID?有优先级继承后,Task_L被提升优先级,不会被Task_M抢占,阻塞时间缩短为Task_L剩余执行时间(9ms),仍可能超过10ms,但可通过调整任务周期或使用中断处理缓解。电感L=10μH,输出电容C=100μF,ESR=5mΩ。 阅读详情

相关推荐

【信息科学与工程学】计算机科学与自动化-——第十五篇云计算 12 公有云里的“多Region + 多AZ“ 02 运营算法01

算法逐步思考推理思考(含数学方程式、对象、资源、任务、进程/协程/线程及对应的代数、约束、目标函数/传递函数/依赖函数、参数及参数的数值范围及边界条件、逐步推理的数学方程式列表、上下文切换、并发/串行/随机/乱序/顺序)算法逐步思考推理思考(含数学方程式、对象、资源、任务、进程/协程/线程及对应的代数、约束、目标函数/传递函数/依赖函数、参数及参数的数值范围及边界条件、逐步推理的数学方程式列表、上下文切换、并发/串行/随机/乱序/顺序)云厂商提高闲置资源利用率。算法复杂度为O(N),N为实例数量。

weixin_49199313的博客 282

linux c 实现 获取系统内存,某进程cpu利用率,以及某端口的网络状况

linux下有top memwatch  netstat 等命令去获取系统的cpu使用率,内存以及对应端口的网络状况。这些信息在显示的时候打印的信息太多,下面就是自定义显示这些信息的一个简单demo。用c语言实现的,其主要的过程基本就是 读取对应的文件,然后从文件中查找对应的信息,然后按照自己定义的格式进行重组显示信息。 此代码不做多余的介绍咯,如果要同时获取多个进程的cpu利用率可以多次调用g

Gaoy9303的博客 1400

ARM的CPU占用率工具

CE系统下的CPU占用率测试工具,对于CE开发的人很有用。

Linux/Ubuntu/Arm设备中通过/proc/stat等文件计算Cpu使用率

proc文件系统是一个伪文件系统,它只存在内存当中,而不占用外存空间。它以文件系统的方式为内核与进程提供通信的接口。用户和应用程序可以通过/proc得到系统的信息,并可以改变内核的某些参数。由于系统的信息,如进程,是动态改变的,所以用户或应用程序读取/proc目录中的文件时,proc文件系统是动态从系统内核读出所需信息并提交的。/proc目录中有一些以数字命名的目录,它们是进程目录。系统中当前运行的每一个进程在/proc下都对应一个以进程号为目录名的目录/proc/pid,它们是读取进程信息的接口。....

点赞的都能无bug通过! 3398

【智能机器人开发全流程:硬件选型、软件架构与ROS实战,打造高效机器人系统】

通过模块化设计与ROS框架的灵活扩展,可快速搭建适应不同场景的机器人系统。实际开发中需重点关注。

dally2的博客 6038

Java对接快递鸟,查询快递物流信息

根据用户输入的订单号,我们的后台识别订单号并根据快递鸟查询快递API接口,实现自动查询的功能。下面是java版本的根据单号查询物流跟踪信息的详细示例代码。只需要下载就可以运行,(自己需要简单的修改)注:登录快递鸟用户管理后台后获得。登录快递鸟用户管理后台。

Roc的博客 958

arm linux下CPU占用过高问题排查方法

方法一: 1.top指令查看各进程的cpu占用情况(top+1:可查看多核cpu情况): 2.对CPU使用率过高的进程的所有线程进行排序 ps H -e -o pid,tid,pcpu,cmd --sort=pcpu | grep MainWin` 3.通过查看/proc中的信息来确定高CPU线程. 打印了4列,线程ID,线程名,用户时间和内核时间(排名未分先后) `awk '{print $1,$2,$14,$15}' /proc/689/task/*/stat` 4.找出进程中线程情况 使用g

Garden的博客 4199

极简JEPA世界模型实战:低门槛复现LeWorldModel,CPU可跑

这次我们来看一个能让普通开发者真正上手跑起来的“世界模型”项目。如果你对Yann LeCun提出的JEPA(联合嵌入预测架构)框架感兴趣,但又苦于Meta官方实现过于庞大复杂,那么这个GitHub上4k star的项目就是为你准备的。它用极简的PyTorch代码(核心文件仅160-278行)完整复刻了包括LeWorldModel在内的五个JEPA核心变体,最大的亮点是: 门槛极低,普通笔记本甚至CPU就能跑,显存占用友好,非常适合学习和原理验证。 这个项目名为 keon/jepa ,完全开源。它剥离了工业级

weixin_29031161的博客 421

cpufreq 五种模式

cpufreq是一个动态调整cpu频率的模块,系统启动时生成一个文件夹/sys/devices/system/cpu/cpu0/cpufreq/,里面有几个文件,   其中scaling_min_freq代表最低频率,scaling_max_freq代表最高频率,scalin_governor代表cpu频率调整模式,用它来控制CPU频率 其中   1,performance :顾名思义

zhenwenxian的专栏 3万+

如何懂固高卡以及滚筒轴+平移轴配合运动?

🏆本文收录于专栏,主要记录项目实战过程中所遇到的Bug或因后果及提供真实有效的解决方案,希望能够助你一臂之力,帮你早日登顶实现财富自由🚀;同时,欢迎大家!持续更新中,up!up!up!!

**My Coding Family** 847

把 ABAP writable CDS view entity 讲透:从只读建模到可写模型的 ABAP CDS 新能力

摘要:SAP引入的writable CDS view entity突破了传统CDS视图只读的限制,允许通过ABAP SQL直接进行数据修改。该特性通过WRITABLE关键字定义,使CDS视图成为与数据库表同等级别的可写对象。其核心价值在于为数据集成、中间层同步等场景提供结构化写入入口,但需注意不应绕过业务规则。最佳实践建议保持底层表结构简单映射,避免复杂变形。这一特性标志着CDS从单纯消费模型向双向数据交互能力的演进,为ABAP开发提供了新的数据边界设计思路。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 1313

linux. 获得cpu利用率 arm,Linux如何统计进程的CPU利用率

0. 为什么写这篇博客Linux的top或者ps都可以查看进程的cpu利用率,那为什么还需要了解这个细节呢。编写这篇文章呢有如下三个原因:*希望在脚本中,能够以过”非阻塞”的方式获取进程cpu利用率*ps无法获得进程当前时刻的CPU利用率;top则需要至少1秒才能获得进程当前的利用率**好奇1. 如何统计进程CPU利用率1.0 概述在Linux的/proc文件系统,可以看到自启动时候开始,...

weixin_42365176的博客 2621

【UG\NX二次开发】多个带ui的dll怎么整合到一个dll

NX二次开发-群精选」专栏收录了那些曾散落在聊天对话框里的精彩的知识分享,这都是被遗落的宝贵财富。让我们一起向大佬学习,充满激情地进步,不断超越自己。底部联系方式,欢迎您加入一起交流。有大佬知道多个带ui的dll怎么整合到一个dll吗。

王牌飞行员_里海的博客 284

cpufreq schedutil调频机制解析

重点分析目前常用的schedutil这个cpufreq的governor

m0_72502585的博客 3471

沁恒CH32V30X学习笔记02--GPIO的使用教程及2次封装驱动

刚复位后,GPIO 口运行在初始状态,这时大多数 IO 口都是运行在状态所有的 GPIO 口都可以被配置外部中断输入通道,但一个外部中断输入通道最多只能映射到一个GPIO 引脚上,且外部中断通道的序号必须和 GPIO 端口的位号一致,,两方都是一对一的关系。复用功能。

Car12 706

【深度学习|语义分割之UNet】如何使用ResNet50 作为 U-Net 网络的骨干网络(backbone)并使用预训练的 ResNet50 模型。附代码及解读。

【深度学习|语义分割之UNet】如何使用ResNet50 作为 U-Net 网络的骨干网络(backbone)并使用预训练的 ResNet50 模型。附代码及解读。

985小水博的摸鱼日常 3090

i.MX31移动SoC架构解析:ARM11与PowerVR GPU的异构计算实践

在嵌入式系统与移动计算领域,系统级芯片(SoC)通过集成通用处理器核心与专用硬件加速单元,实现了性能与功耗的平衡,这一设计理念是异构计算的核心。其原理在于为不同计算任务分配合适的硬件单元,例如通用CPU处理逻辑与控制,专用GPU负责图形渲染,专用IPU处理视频流。这种分工协作的技术价值在于,能在有限的功耗预算内,显著提升多媒体处理效率,满足早期移动设备对流畅视频播放和3D图形渲染的迫切需求。应用场景广泛覆盖了便携式媒体播放器(PMP)、带摄像功能的智能设备以及掌上3D游戏等。本文以飞思卡尔i.MX31处理器

weixin_30906185的博客 342

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

调整开发板arm的cpu频率

原文转自:https://blog.youkuaiyun.com/zhenwenxian/article/details/6196943   cpufreq是一个动态调整cpu频率的模块,系统启动时生成一个文件夹/sys/devices/system/cpu/cpu0/cpufreq/,里面有几个文件,   其中scaling_min_freq代表最低频率,scaling_max_freq代表最高频率...

qq_33783896的博客 6994

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

深度学习工具包 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")

如何使用CPU cooling API

文章目录0.简介1. cpu cooling API1.1 cpufreq registration/unregistration API2.电源模型 0.简介 通用cpu cooling(freq clipping)子系统为调用者提供registration/unregistration API。cooling devices与trip point的绑定留给用户。注册API返回cooling d...

win9 1024

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

Swin2SR在嵌入式系统中的应用:低功耗图像处理方案

本文介绍了如何在星图GPU平台上自动化部署🔍 AI 显微镜 - Swin2SR镜像,实现低功耗、高精度的图像超分辨率重建。该镜像专为嵌入式环境优化,典型应用于智能监控中的车牌清晰化、工业质检的微小焊点增强等场景,显著提升OCR识别率与缺陷检出率。

weixin_42576410的博客 449

如何用Uperf-Game-Turbo实现Android性能优化:开发者终极指南

Uperf-Game-Turbo是一款革命性的Android用户态性能控制器,它重新定义了移动设备性能优化的边界。不同于传统的内核层性能调控方案,Uperf在用户空间实现了对系统性能的精细控制,支持Android 6.0+和arm64-v8a架构,无需修改内核源码或依赖特定硬件平台,为开发者提供了前所未有的性能调优自由度。 ## 性能优化的新范式:用户态性能控制技术揭秘 传统Android性能

gitblog_01142的博客 801

ARM MPU子系统CRPM深度解析:时钟、复位与电源管理实战指南

在嵌入式系统与SoC设计中,时钟、复位与电源管理(CRPM)是确保系统稳定、高效与低功耗运行的底层核心技术。其原理在于为处理器核心、总线及外设提供精准的时序基准(时钟)、可靠的初始化状态(复位)以及动态的能量供给(电源)。这套机制的技术价值在于,它是实现高性能计算、实时响应与超低功耗等关键系统指标的基础。尤其在物联网、移动设备和工业控制等对功耗与可靠性要求严苛的应用场景中,精细的CRPM设计直接决定了产品的续航能力与稳定性。本文以经典的ARM Cortex-A8 MPU子系统为例,深入剖析其时钟域划分、复位

weixin_30920597的博客 344

Devfreq Bus Dcvs

一、引言计算机的世界里,CPU任务分为CPU bound和IO bound。而实际场景下往往是两者混合型任务。针对性能的优化,普遍关注点都在CPU上(不论是CPU的频点和CPU的选核), ...

内核工匠 6361

选对调度器,让你的设备“纵享丝滑”

ESA调度器为何选择WALT算法?

DingdaoOS的博客 628

MCP 2026国产化部署“静默降频”问题溯源:从龙芯3A5000微架构到JVM ZGC参数的12层链路压测实录

精准定位MCP 2026国产化部署优化方法,根治“静默降频”难题。基于龙芯3A5000平台,贯通12层软硬链路压测,聚焦JVM ZGC参数调优与微架构协同优化,显著提升信创环境稳定性与吞吐量。值得收藏

BreakVein的博客 178

Linux Schedutil 调频器:调度器感知的智能频率调节

文章摘要: 本文系统介绍Linux内核的Schedutil调频器,对比传统ondemand方案,其通过调度器实时负载统计(cpu_util)实现动态调频(DVFS),显著提升频率切换的平滑性与实时性。内容涵盖: 原理:Schedutil直接复用调度器负载数据,线性计算目标频率,通过工作队列异步执行调频,结合rate_limit_us参数防抖频; 实操:环境配置、调频器切换(sysfs接口)、压力测试对比(stress工具)及参数调优(升/降频延迟); 源码分析:解析sugov_policy结构体、sugov

望获实时Linux系统 398
上一篇: 【python】【OrderedDict】处理文本文件
下一篇: 【cpuidle】计算每个cpu进入idle的时间
money_yuan
博客等级 码龄10年 104粉丝 80原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值