《Python等级认证CCF-GESP真题解析》专栏总目录

❤️ 专栏名称:《Python等级认证CCF-GESP真题解析》
🌸 专栏介绍:中国计算机学会GESP《CCF编程能力等级认证》Python编程(1~8级)历届真题解析。
🚀 订阅专栏:订阅后可阅读专栏内所有真题解析,真题持续更新中,限时19.9元,欢迎订阅!

Python编程一级

序号日期真题直达链接
12023年03月https://blog.csdn.net/gozhuyinglong/article/details/135954852
22023年06月https://blog.csdn.net/gozhuyinglong/article/details/135954064
32023年09月https://blog.csdn.net/gozhuyinglong/article/details/135952990
42023年12月https://blog.csdn.net/gozhuyinglong/article/details/135951785
52024年03月https://gozhuyinglong.blog.csdn.net/article/details/137995625
62024年06月https://gozhuyinglong.blog.csdn.net/article/details/140136563
72024年09月https://gozhuyinglong.blog.csdn.net/article/details/143781392
82024年12月https://gozhuyinglong.blog.csdn.net/article/details/144595593
92025年03月https://gozhuyinglong.blog.csdn.net/article/details/160183354
102025年06月https://gozhuyinglong.blog.csdn.net/article/details/160223122
112025年09月https://gozhuyinglong.blog.csdn.net/article/details/160327734
122025年12月https://gozhuyinglong.blog.csdn.net/article/details/160372752
132026年03月https://gozhuyinglong.blog.csdn.net/article/details/160374085
142026年06月持续更新中…

Python编程二级

序号日期真题直达链接
12023年03月https://blog.csdn.net/gozhuyinglong/article/details/135966898
22023年06月https://blog.csdn.net/gozhuyinglong/article/details/135966743
32023年09月https://blog.csdn.net/gozhuyinglong/article/details/135957162
42023年12月https://blog.csdn.net/gozhuyinglong/article/details/135956835
52024年03月https://gozhuyinglong.blog.csdn.net/article/details/138221962
62024年06月https://gozhuyinglong.blog.csdn.net/article/details/140250856
72024年09月https://gozhuyinglong.blog.csdn.net/article/details/143782564
82024年12月https://gozhuyinglong.blog.csdn.net/article/details/144677754
92025年03月https://gozhuyinglong.blog.csdn.net/article/details/160187079
102025年06月https://gozhuyinglong.blog.csdn.net/article/details/160237008
112025年09月https://gozhuyinglong.blog.csdn.net/article/details/160335146
122025年12月https://gozhuyinglong.blog.csdn.net/article/details/160375367
132026年03月https://gozhuyinglong.blog.csdn.net/article/details/160376542
142026年06月持续更新中…

Python编程三级

序号日期真题直达链接
12023年06月https://blog.csdn.net/gozhuyinglong/article/details/135967798
22023年09月https://blog.csdn.net/gozhuyinglong/article/details/135967423
32023年12月https://blog.csdn.net/gozhuyinglong/article/details/135967116
42024年03月https://gozhuyinglong.blog.csdn.net/article/details/138223528
52024年06月https://gozhuyinglong.blog.csdn.net/article/details/140278813
62024年09月https://gozhuyinglong.blog.csdn.net/article/details/143839099
72024年12月https://gozhuyinglong.blog.csdn.net/article/details/144678394
82025年03月https://gozhuyinglong.blog.csdn.net/article/details/160201219
92025年06月https://gozhuyinglong.blog.csdn.net/article/details/160251173
102025年09月https://gozhuyinglong.blog.csdn.net/article/details/160336143
112025年12月https://gozhuyinglong.blog.csdn.net/article/details/160395406
122026年03月https://gozhuyinglong.blog.csdn.net/article/details/160399684
132026年06月持续更新中…

Python编程四级

序号日期真题直达链接
12023年06月https://blog.csdn.net/gozhuyinglong/article/details/135968541
22023年09月https://blog.csdn.net/gozhuyinglong/article/details/135968444
32023年12月https://blog.csdn.net/gozhuyinglong/article/details/135968187
42024年03月https://gozhuyinglong.blog.csdn.net/article/details/138224196
52024年06月https://gozhuyinglong.blog.csdn.net/article/details/140293104
62024年09月https://gozhuyinglong.blog.csdn.net/article/details/143839948
72024年12月https://gozhuyinglong.blog.csdn.net/article/details/144702539
82025年03月https://gozhuyinglong.blog.csdn.net/article/details/160203894
92025年06月https://gozhuyinglong.blog.csdn.net/article/details/160252700
102025年09月https://gozhuyinglong.blog.csdn.net/article/details/160338435
112025年12月https://gozhuyinglong.blog.csdn.net/article/details/160406864
122026年03月https://gozhuyinglong.blog.csdn.net/article/details/160408178
132026年06月持续更新中…

Python编程五级

序号日期真题直达链接
12023年09月https://blog.csdn.net/gozhuyinglong/article/details/135985854
22023年12月https://blog.csdn.net/gozhuyinglong/article/details/135985543
32024年03月https://gozhuyinglong.blog.csdn.net/article/details/138224522
42024年06月https://gozhuyinglong.blog.csdn.net/article/details/140293790
52024年09月https://gozhuyinglong.blog.csdn.net/article/details/143865835
62024年12月https://gozhuyinglong.blog.csdn.net/article/details/144703386
72025年03月https://gozhuyinglong.blog.csdn.net/article/details/160209163
82025年06月https://gozhuyinglong.blog.csdn.net/article/details/160254089
92025年09月https://gozhuyinglong.blog.csdn.net/article/details/160339134
102025年12月https://gozhuyinglong.blog.csdn.net/article/details/160409730
112026年03月https://gozhuyinglong.blog.csdn.net/article/details/160410701
122026年06月持续更新中…

Python编程六级

序号日期真题直达链接
12023年09月https://blog.csdn.net/gozhuyinglong/article/details/135985983
22023年12月https://blog.csdn.net/gozhuyinglong/article/details/135985892
32024年09月https://gozhuyinglong.blog.csdn.net/article/details/143868243
42024年12月https://gozhuyinglong.blog.csdn.net/article/details/144728192
52025年03月https://gozhuyinglong.blog.csdn.net/article/details/160217376
62025年06月https://gozhuyinglong.blog.csdn.net/article/details/160254166
72025年09月https://gozhuyinglong.blog.csdn.net/article/details/160340103
82025年12月https://gozhuyinglong.blog.csdn.net/article/details/160412667
92026年03月https://gozhuyinglong.blog.csdn.net/article/details/160434221
102026年06月持续更新中…

Python编程七级

序号日期真题直达链接
12023年12月https://blog.csdn.net/gozhuyinglong/article/details/136483081
22025年03月https://gozhuyinglong.blog.csdn.net/article/details/160218798
32025年12月https://gozhuyinglong.blog.csdn.net/article/details/160442150
42026年06月持续更新中…

Python编程八级

序号日期真题直达链接
12023年12月https://blog.csdn.net/gozhuyinglong/article/details/136497368
22024年03月https://gozhuyinglong.blog.csdn.net/article/details/138275691
32026年06月持续更新中…
2024年03月CCF-GESP编程能力等级认证Python编程四级真题解析 小杨的父母最近刚刚给他买了一块华为手表,他说手表上跑的是鸿蒙,这个鸿蒙是?( ) A. 小程序 B. 计时器 C. 操作系统 D. 神话人物 阅读详情

相关推荐

2023年12月CCF-GESP编程能力等级认证Python编程七级真题解析

可以先找 2 号商⼈,花 2 - 1 = 1 元的差价以及 1 元⼿续费换得商品 1,再找 4 号商⼈,花 4 - 2 = 2 元的差价以及 1 元手续费换得商品 2。对关键字序列{44,36,23,35,52,73,90,58}建立哈希表,哈希函数为 h(k)=k%7,执行下面的 Insert 函数,则等概率情况下的平均成功查找长度(即查找成功时的关键字比较次数的均值)为( )。可以找 2 号商⼈,直接换得商品 2 的同时,赚取 100- 4 = 96 元差价,再⽀付 1 元⼿续费,净赚 95 元。

人生就是一个不断学习的过程 850

2024年09月CCF-GESP编程能力等级认证Python编程四级真题解析

小杨有一个n行m列的网格图,其中每个格子要么是白色,要么是黑色。小杨想知道网格图中是否存在一个满足如下条件的子矩形: 子矩形由4行4列组成; 子矩形的第1行和第4行只包含白色格子; 对于子矩形的第2行和第3行,只有第1个和第4个格子是白色的,其余格子都是黑色的; 请你编写程序帮助小杨判断。 输入格式 第一行包含一个正整数t,代表测试用例组数。 接下来是t组测试用例。对于每组测试用例,一共+1行。 第一行包含两个正整数n,m,含义如题面所示。 之后n行,每行一个长度为m的01串,代表网格图第

人生就是一个不断学习的过程 2567

2024年09月CCF-GESP编程能力等级认证Python编程一级真题解析

小杨有n个正整数,他认为一个正整数是美丽数字当且仅当该正整数是9的倍数但不是8的倍数。 小杨想请你编写一个程序计算n个正整数中美丽数字的数量。

人生就是一个不断学习的过程 943

2024年06月CCF-GESP编程能力等级认证Python编程三级真题解析

小杨学习了加密技术移位,所有大写字母都向后按照一个固定数目进行偏移。偏移过程会将字母表视作首尾相接的环,例如,当偏移量是3的时候,大写字母 A 会替换成 D,大写字母 Z 会替换成 C,总体来看,大写字母表ABCDEFGHIJKLMNOPQRSTUVWXYZ 会被替换成 DEFGHIJKLMNOPQRSTUVWXYZABC。

人生就是一个不断学习的过程 1429

2024年06月CCF-GESP编程能力等级认证Python编程二级真题解析

⼩杨⽗母带他到某培训机构给他报名参加CCF组织的GESP认证考试的第1级,那他可以选择的认证语⾔有⼏种?( ) A. 1 B. 2 C. 3 D. 4

人生就是一个不断学习的过程 1367

2024年09月CCF-GESP编程能力等级认证Python编程三级真题解析

1、平衡序列 题面描述 小杨有一个包含n个正整数的序列a,他认为一个序列是平衡的当且仅当存在一个正整数i(1≤ i

人生就是一个不断学习的过程 641

2023年12月CCF-GESP编程能力等级认证Python编程二级真题解析

某公司新出了一款无人驾驶的小汽车,通过声控智能驾驶系统,乘客只要告诉汽车目的地,车子就能自动选择一条优化路线,告诉乘客后驶达那里。请问下面哪项不是驾驶系统完成选路所必须的。( )A:麦克风B:扬声器C:油量表D:传感器。

人生就是一个不断学习的过程 914

2023年03月CCF-GESP编程能力等级认证Python编程二级真题解析

以下存储器中的数据不会受到附近强磁场干扰的是( )。A:硬盘B:U 盘C:内存D:光盘。

人生就是一个不断学习的过程 948

2024年12月CCF-GESP编程能力等级认证Python编程一级真题解析

小杨最近学习了开尔文温度、摄氏温度和华氏温度的转换。令符号 表示开尔文温度,符号 表示摄氏温度,符号 表示华氏温度,这三者的转换公示如下: 现在小杨想编写一个程序计算某一开尔文温度对应的摄氏温度和华氏温度,你能帮帮他吗?

人生就是一个不断学习的过程 804

2023年12月CCF-GESP编程能力等级认证Python编程一级真题解析

某公司新出了一款无人驾驶的小汽车,通过声控智能驾驶系统,乘客只要告诉汽车目的地,车子就能自动选择一条优化路线,告诉乘客后驶达那里。请问下面哪项不是驾驶系统完成选路所必须的。( )(2023年12月py一级)A:麦克风B:扬声器C:油量表D:传感器。

人生就是一个不断学习的过程 1126

2024年09月CCF-GESP编程能力等级认证Python编程二级真题解析

7的各位数字之和为7,是7的倍数。52的各位数字之和为5+2=7,是7的倍数。103的各位数字之和为1+0+3=4,不是7的倍数。 数据范围 对于全部数据,保证有1 ≤ n ≤ 105,1 ≤ ai≤105。

人生就是一个不断学习的过程 710

2024年09月CCF-GESP编程能力等级认证Python编程六级真题解析

2、算法学习 题面描述 小杨计划学习m种算法 ,为此他找了 n道题⽬来帮助⾃⼰学习 ,每道题⽬至多学习⼀次。 小杨对于m种算法的初始掌握程度均为0。第i道题⽬有对应的知识点ai, 即学习第 i道题⽬可以令⼩杨对第ai种 算法的掌握程度提⾼ bi。小杨的学习⽬标是对m种算法的掌握程度均⾄少为k。 小杨认为连续学习两道相同知识点的题⽬是不好的 ,小杨想请你编写程序帮他计算出他最少需要学习多少道题⽬才 能使得他在完成学习⽬标的同时避免连续学习两道相同知识点的题⽬ 。 输入格式 第⼀行三个正整数m, n

人生就是一个不断学习的过程 663

2024年12月CCF-GESP编程能力等级认证Python编程二级真题解析

小杨有一个正整数 ,小杨想知道是否存在一个正整数 满足 。 3.1.2 输入格式 第一行包含一个正整数 ,代表测试数据组数。 对于每组测试数据,第一行包含一个正整数代表 。 3.1.3 输出格式 对于每组测试数据,如果存在满足条件的正整数 ,则输出 ,否则输出 。

人生就是一个不断学习的过程 712

2024年09月CCF-GESP编程能力等级认证Python编程五级真题解析

小杨正在和一个怪物战斗,怪物的血量为h ,只有当怪物的血量恰好为0 时小杨才能够成功击败怪物。 小杨有两种攻击怪物的方式: 物理攻击。假设当前为小杨第i 次使用物理攻击,则会对怪物造成2i-1点伤害。 魔法攻击。小杨选择任意一个质数x(x不能超过怪物当前血量),对怪物造成x点伤害。由于小杨并不擅长魔法,他只能使用至多一次魔法攻击。 小杨想知道自己能否击败怪物,如果能,小杨想知道自己最少需要多少次攻击。。 输入格式 第一行包含一个正整数t,代表测试用例组数。 接下来是t组测试用例。对于每组测试用

人生就是一个不断学习的过程 681

嵌入式存储进阶:除了KV存储,EasyFlash的IAP和LOG功能怎么玩?

本文深入探讨了嵌入式存储方案EasyFlash的高级功能,包括在线固件升级(IAP)和闪存日志存储(LOG)。通过详细解析IAP的双区备份设计和LOG的环形缓冲区架构,提供硬件适配、安全升级流程和日志管理技巧等实战指南,帮助开发者在物联网设备中实现可靠的数据存储和固件更新。

weixin_29280219的博客 416

AI算力瓶颈与系统优化实战指南

AI算力瓶颈已成为制约人工智能发展的关键因素,特别是在处理transformer类模型时,传统的冯·诺依曼架构面临严重的'内存墙'问题。通过硬件加速、系统优化和算法改进的三级策略,可以有效提升资源利用率。在嵌入式AI领域,结合量化、剪枝和专用指令集扩展等技术,能在资源受限设备上实现高效推理。这些优化方法在自动驾驶、工业视觉等场景中已展现出显著价值,推动AI应用从云端向边缘迁移。随着AI算力需求的持续增长,掌握系统优化技能将成为开发者的核心竞争力。

weixin_32597009的博客 346

别再对着数据手册发愁了!用HFSS 2023 R2搞定ESP32-C3板载天线的阻抗匹配

本文详细介绍了如何利用HFSS 2023 R2进行ESP32-C3板载天线的阻抗匹配优化,解决实际PCB设计中常见的性能偏差问题。通过智能模型导入、科学参数扫描和量化优化流程,显著提升天线性能,适用于WIFI和蓝牙应用场景。

weixin_42523543的博客 451

CXL ALMP(ARB/MUX Link Management Packet)理解

ALMP(ARB/MUX Link Management Packet) 是CXL协议中由ARB/MUX层生成和处理的专用管理报文,用于协调链路电源状态切换(如L0s/L1)和虚拟链路状态机(vLSM)同步。ALMP是ARB/MUX层的控制平面报文,专用于以下场景:协调多协议(CXL.io、CXL.cachemem等)的链路状态切换(如L1进入/退出)。维护各协议独立的虚拟链路状态机(vLSM) 状态同步。在物理层(PHY)与链路层(Link Layer)之间仲裁电源管理请求。

Summer的博客 1202

【OpenSearch】从零到一:手把手搭建OpenSearch与Dashboard可视化平台

本文提供了一份详细的OpenSearch与Dashboard可视化平台从零搭建指南。内容涵盖环境准备、系统调优、核心服务安装配置、Dashboard部署与汉化,以及生产环境安全加固建议,帮助用户快速构建一个功能完整的搜索与分析平台。

devops8pract的博客 619

VASPKIT绘制平面平均电荷差分密度

平面平均密度差(planar-averaged electron density difference)是密度差的衍生。密度差是个三维空间函数,经常通过绘制平面图、等值面图方式图形化考察。虽然这两种图很直观,但平面图会受到截面选取的影响,而等值面图会受到等值面数值(isovalue)选取的影响,因此都有一定任意性,也不容易定量讨论。对于电子转移有比较明确方向的情况,可以绘制平面平均密度差曲线,由此可以清楚地考察垂直于选取的方向上每个截面上的密度差积分值,在定量讨论、对比上比较便利。

weixin_43948934的博客 1万+

手把手教你学simulink实例--基于Simulink的船舶动力定位系统建模与仿真

船舶动力定位系统(Dynamic Positioning System, DPS)是一种通过控制推进器来保持船舶在指定位置和航向的技术。它广泛应用于海上钻井平台、海洋调查船、起重船等需要精确位置控制的场景。DPS的核心任务是实时感知环境干扰(如风、浪、流),并通过闭环控制算法调整推进器输出,以抵消外界扰动并维持船舶的位置和姿态。本项目旨在基于MATLAB/Simulink平台,构建船舶动力定位系统的数学模型,并进行仿真分析,验证其性能和稳定性。

MHD0815的博客 1087

基于知识图谱的档案智慧问答系统:构建智能化档案管理与知识服务新范式

基于知识图谱的档案智慧问答系统是档案管理领域的一次重要创新,它通过将档案数据转化为结构化的知识图谱,并结合自然语言处理和智能问答技术,实现了档案信息的智能化管理与服务。该系统不仅能够提升档案管理的效率,还能为用户提供更全面、更便捷的知识服务,具有广泛的应用前景和深远的社会意义。未来,随着技术的不断进步和应用场景的不断扩展,基于知识图谱的档案智慧问答系统将在更多领域发挥其价值,为档案管理领域的智能化转型提供强有力的支持。

qq_62634009的博客 1580

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

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

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

上一篇: 2023年09月CCF-GESP编程能力等级认证Python编程六级真题解析
下一篇: 2023年12月 Python(三级)真题解析#中国电子学会#全国青少年软件编程等级考试
码农StayUp
码农StayUp 优质创作者: 编程框架技术领域 优质创作者: 编程框架技术领域 领域专家: 系统编程技术领域 领域专家: 系统编程技术领域
博客等级 码龄18年 1万+粉丝 719原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

打赏作者

码农StayUp

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

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

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

打赏作者

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

抵扣说明:

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

余额充值
⌂ 换网址