SCIE1000 Python and Communication

SpringBoot+Vue+MySQL 高校学科竞赛平台 完整可运行版(源码+文档) 本项目基于SpringBoot+Vue+MySQL构建高校学科竞赛管理平台,覆盖学生、教师、领队教师、管理员四大角色,实现竞赛发布、报名、刷题、评分、公示等全流程闭环管理。系统架构清晰,技术主流,配套完整源码、数据库脚本、万字论文、开题报告、答辩PPT及部署文档,支持一键运行,适用于毕业设计、课程设计及院系二次开发,真正实现“开箱即用”。 阅读详情

SCIE1000 Semester 2, 2024

Python and Communication Assignment

1    The scenario

A new public science museum in St Lucia is developing an exhibit. A feature of the museum is that each exhibit item is accompanied by two explanations, each written for a different audience.  One explanation is pitched to the “science rookie” and the other to the “science enthusiast” .  Patrons read the explanation tailored to the level at which they feel most comfortable. Some characteristics of typical patrons in each category are described in Table 1.

Table 1: Characteristics of different patrons

Patron Type

Typical characteristics

Science Rookie

Not familiar with scientific terminology or notation;

will need terminology explained using a simple vocabulary; is unfamiliar with graphs;

may be a younger person, possibly 10+ years of age; likes to press buttons.

Science Enthusiast

Familiar with common scientific terminology and notation (not overly technical); can handle terminology explained using somewhat sophisticated vocabulary;

is prepared to read longer passages of moderate complexity; likes to know about modelling assumptions and limitations;

is familiar with graphs; likes to press buttons.

The museum is planning an exhibition called  “Plastics in our Oceans:  A  Cautionary Tale” which examineshow humankind’s voracious appetite for the production and consumption of plastic products can have calamitous consequences for the natural environment around us. The aim of the exhibition is summarised in the following passage from the exhibition prospectus:

Plastics have revolutionised the cost-effectiveness and versatility of manufacturing in the post-war era.  Plastics have  become so  commonplace  in modern times  that it is hard to imagine  life  without  them.   However,  as  plastic  consumption  has  increased,  so  too  has our knowledge and understanding of the potentially devastating impacts of mismanaged plastic waste. As we plan for a more sustainable future, we must examine our dependency on plastics  and the  consequences  of inaction  on  the future  health  and prosperity  of the planet.

In this particular exhibit, patrons will gain a sense of scale for the rate at which the plastic products humans produce are entering marine environments, both now, and in the future.

The museum director has asked the SCIE1000 teaching team for help in finding skilled volunteers to develop exhibit items. Once developed, the items will be maintained and potentially modified by museum staff, each of whom has a strong background in high-school mathematics combined with a beginners level of Python experience.  The director has been informed that SCIE1000 students are skilled at:  making mathematical models using a mathematical toolkit familiar to any student who has completed intermediate level high school maths (aka Mathematical Methods, or equivalent); writing Python programs, including those which use arrays, loops, plots and user-defined functions; and communicating scientific information to a variety of audiences.

2    An overview of the task

You will write an interactive Python program that will run on a machine in the exhibition hall at the new science museum as part of this exhibition. Your program will guide users to a better under- standing of the scale of plastic production and the impact this may have on marine environments. The information you need to create the relevant model is provided in Section 5 of this document, and a high-level overview of how to complete the task is provided in Section 6.

This assignment requires you to produce two deliverables, (D1) and (D2), as outlined below:

(D1) A Python code file that satisfies the specifications in Section 7.  This includes following the logical flow laid out in the flowchart provided in Figure 3 (see Page 10).

(D2) An audio-video screencapture file (3-5 minutes long) in which you show your code and give an overview of your approaches to modelling, programming and communication, aimed at museum staff who will need to maintain your code.  One way to create such a file is by recording with Zoom (open a Zoom meeting, share your screen, and select Record → Record to this computer). Please note that 5 minutes is a hard upper limit for the recording, and museum staff will stop watching your video at the 5 minute mark.

3    Submission and grading

Both deliverables (D1) and (D2) are to be uploaded via the Blackboard submission link by 1pm on October 15, 2024. If your video file is large, or if there are many other Blackboard users, it can take time for your video file to load and you need to wait for your browser to complete the submission. The  UQ guidelines on Blackboard assignment submissions recommend submitting at least 3 hours be- fore the deadline, in case of any internet/computer/technical issues. If you do have technical issues, you should contact the student IT service  “AskUs” at the library.   Late  submissions without an approved extension will be penalised according to the policy in the Course Profile; consult the Course Profile for more information.

Your submitted code will be run and tested as part of this grading process. A rubric (grading criteria) for this assignment is on Page 11.  The file that you submit will be checked using software which is specially designed to detect plagiarism in code.  Consult the Course Profile for more information and procedures concerning plagiarism.

This assignment has an advanced section which must be attempted by students aiming for grades of 6 or 7 (see the grading criteria for more explanation). The shaded section of the flowchart indicates the requirements of this advanced section.   If you  have  any  questions, please contact the course lecturers via the course discussion board (see Section 4 below).

4    About getting help

This assignment is a piece of summative assessment, designed to let you demonstrate your level of mastery of several learning objectives in this course.  As such, it is very important that the work you submit is all your own. This does not mean that you cannot receive help in regards to this assignment, but that help must be limited to general advice about modelling, Python and communication. This task sheet has been carefully constructed, and part of your job is to interpret the information it contains. Some choices have been left to your judgement, and this is intentional.

Remember that you must not look at anyone else’s code and you must not show your code to anyone. Both of these actions are examples of behaviour that may be considered academic misconduct.  No code from your assignment attempt should be posted on the course discussion board, or any other site, at any time.  However, if you have problems with your code, you may develop some generic sample code that demonstrates the issue that you are having (but does not relate to the assignment). This can be discussed with others and/or posted to the course discussion board for assistance.  All such discussion board posts must be made visible to all students, so that everyone can see the question and the answer from lecturers.

5    Modelling plastic entering the ocean

5.1    Plastic production

The term plastic refers to a broad group of synthetic polymers that have become ubiquitous in modern manufacturing due to their low production cost and broad utility across a huge range of dif- ferent industries including packaging, consumer products, textiles, transportation, construction and electronics.  The origin of large scale plastic production dates back to the  1950s and global plastic production has increased year-on-year in all but three years since then [1].

  

Figure 1: Examples of different modern plastic.

The museum exhibit aims to convey to patrons the scale of plastic production both now and into the future, and what implications this may have for our oceans.

Selected data for the global rate of plastic production between 1975 and 2017 is provided in Table 2 [2].

Table 2: Data for the annual global rate of plastic production from 1975–2017, sourced from [2] via [3].

Year

Rate of global plastic production (million tonnes·year−1)

1975

1978

1981

1984

1987

1990

1993

1996

1999

2002

2005

2008

2011

2014

2017

46

64

72

86

104

120

137

168

202

231

263

281

325

367

420

Museum staff have provided a model for the rate of global plastic production, given by

P(t) = 50.4 + 2.606t + 0.143t2 ,                                                  (1)

Where P is the rate of global plastic production (in million tonnes·year−1) and t is the time (in years) since 1975. For modelling purposes, you may assume that any relationship for the global rate of plastic production over the interval 1975–2017 can be extrapolated to future years. However, you should clearly communicate to patrons when your model is being used to make predictions beyond the time frame. of the data provided.

5.2    Plastics entering the marine environment

The lifespan of a plastic product is the time that elapses between its creation until it becomes waste. The lifespan of plastics varies significantly depending upon the type of plastic and how it is used.  For example, plastics used in building and construction typically have longer lifespans on the order of decades, whereas plastics used in packaging may have an average lifespan on the order of months [4]. There are many different pathways for dealing with plastic wastes including reuse, recycling, thermal destruction and disposal.  However, reused and recycled plastics eventually need to be disposed of, since these processes cannot be repeated indefinitely [1].  Mismanagement of plastic waste can lead to plastics entering the marine environment.

Estimating how much plastic enters the world’s oceans is a complex problem.  Jambeck  et al.  (2015) developed a framework for estimating the amount of mismanaged plastic waste from coastal popu- lations that could potentially become marine debris. Based on data from 2010, they estimated that approximately 2.96% of the plastic produced in that year ended up as ocean plastic [5], as depicted in Figure 2. Using this information, and the model for plastic production provided in equation (1), you should develop a new model which estimates the global rate at which plastics enter the world’s oceans.  You may assume that this relationship between plastic produced and plastic entering the oceans holds true in other years.

Figure 2: Infographic produced by [3] depicting the proportion of plastic produced that ended up in the world’s oceans in 2010 based on [5].

5.3    A compounding problem

Once plastics have entered the marine environment they can remain there for a long time.  In the ocean, plastics do not generally biodegrade on a timescale that would contribute to the removal of plastics from the environment.  Instead, plastics at the sea surface are likely to undergo solar UV- induced photodegradation reactions.  This “weathering” of plastic materials in the ocean can cause larger macroplastics to break down into microplastic debris [6].  The small size of such debris creates additional problems for effective detection and can hamper efforts to remove plastics from the ocean. Consequently, without targeted intervention, we can assume that all plastics that have entered the ocean remain in the ocean.

5.4    Impact of plastic on marine environments

Ingestion or interaction with marine plastics (such as through entanglement, ghost fishing, dispersal by rafting and habitat alteration) has been shown to affect more than 800 marine species, many of which are listed as being at risk according to the International Union for Conservation of Nature [7, 8]. These effects can include ill health and death.  Microplastics have been shown to collect in the gut, digestive tract and gills of various marine species when ingested, and some species have been shown to accumulate microplastics in other tissues through translocation [8].

As microplastics contaminate the environment, their presence has  been demonstrated in the food chain.   At lower trophic  levels  in  the  marine  environment,  the  presence  of microplastics has  been reported in zooplankton,  chaetognatha,  ichtyoplankton,  copepods, and salps.   Microplastic  contamination  also  occurs  at  higher  trophic  levels,  in  inverte- brates  (polychaetes,  crustaceans,  echinoderms,  bivalves)  and  vertebrates  (fish,  seabirds, and mammals) . Plastic particles reach them either through direct consumption or through trophic transfer. [10]

5.5    Looking to the future

Geyer (2020) suggests that, based on current trends in plastic production, waste generation, and waste management, recycling and incineration will not be sufficient to sustainably manage plastic in the long term.  Hence it will be important to consider mechanisms for reducing the amount of plastic produced and consumed [1].  Furthermore, sustainable consumption and production have been identified by the United Nations as a key sustainable development goal as part of a larger collective of 17 goals aimed at providing a global vision for achieving a sustainable, just, and safe planet [9].

6    A detailed overview of the task

Your assignment submission must follow the specifications listed in Section 7. Below, we first give a high-level overview of how to approach the main section and the advanced section of this assessment task.

To complete the main section, you will need to:

● Determine an appropriate mathematical function to model the global rate at which plastics enter the marine environment using the information provided in Sections 5.1 and 5.2,  and clearly communicate the potential scale of this issue to patrons.  Your model will be based on the one provided by museum staff in equation (1). You will write a function in your code which implements the ocean plastics model. Your function should take one input, time in years since 1975, and return an estimate of the global rate at which plastics enter the marine environment (in million tonnes · year−1) at that time.

● Produce a graph of the model of the rate of plastic entering the ocean.

● To give patrons a sense of the scale of plastic entering the ocean, you should include a com- parison for patrons which depends on the output of your model for the global rate of plastic entering the ocean. Your comparison should provide patrons with a clear understanding of the scale of the mass of plastic entering the ocean in their chosen year, by comparing it the mass of an object or objects that would be familiar to the patrons.

● Communicate appropriately with museum patrons as informed by the main section of the flowchart in Figure 3.

● Include a description of how you approached this section of your code in your screen capture video (D2), including (briefly) how you developed your models and the overall code structure.

To complete the advanced section, you will need to:

● Explore other models for the rate of plastics entering the ocean, using methods covered in SCIE1000.  You will write a function in your code which implements your chosen alternative model.   Create  a  graph that compares your  alternative model to the quadratic model and present this to the science enthusiast.

● Calculate the predicted doubling time from the present year using your alternative model.

● Communicate appropriately with museum patrons as informed by the the advanced section of the flowchart in Figure 3.

● Include a description of how you approached this section of your code in your screencapture video (D2), including how you developed your models.

7    Specifications for your submitted file

7.1    Specifications about the Python

● Museum staff have supplied a flowchart describing how the program should run (Figure 3 on Page 10). Your code must be an implementation of the flowchart provided.

● Your code must be well-structured and follow the guidelines for programming practice,  as introduced in SCIE1000.

● Whenever you prompt the user for information, you may assume they enter a suitable number, and you can store their answer as an integer or as a floating point number as appropriate.  You

do not need to check for incorrect inputs.

● You may only use Python commands introduced in SCIE1000.  Recall that museum staff must be able to maintain and modify the code, so you may only use commands that they understand. Museum staff have a beginner’s level of experience using Python, which you may regard as the equivalent of a student who has taken SCIE1000.  The Python commands you have covered in this course should be more than sufficient to complete the assignment.

● Museum staff have identified functions that they think will be useful in possible modifications and extensions of the code.  You must define these functions in your code.  You should use these functions in your code as appropriate. You may define other new functions as needed.

7.2    Specifications about the communication

● All messages to the user, including prompts to enter data, should communicate in a manner appropriate for the level of patron and should serve the purpose of the program.

● You should write no more than a couple of sentences for each piece of information you explain to the user. Follow the principles for communication in science as described in Appendix B of the workbook. Be precise, clear and concise!

● You should use units appropriately in your communication with the user.  Make sure you are aware of the units of values being passed into functions and the units of values being returned from functions.

● You should include useful and appropriate comments in your code to help the museum staff who may need to maintain and modify the code.  Any variable names and function names you define should be chosen with communication in mind.

● Whenever you produce a graph you should provide appropriate labels and accompanying explanatory text.

● Your screen capture video should provide a clear overview of how your code works and why you made the choices you did.  This does not replace excellent commenting in the code.

● To reference sources other than those cited in this task sheet, you should include a bibliography as comments at the end of your code, to show the museum staff maintaining the code where you obtained any relevant information you used. You may use any referencing style.

7.3    File type and file name

● Your assignment (D1) should be saved as a .py file called PlasticOceans********.py with the string ******** replaced by your student number.

● Your screencapture audio/video file  (D2)  should  be saved  as  Explanation********.mp4 with the string ******** replaced by your student number.

● It is your responsibility to ensure that the file types are correct.

GPlates——【将化石点标记在古地理图上时,改变标记点的大小和形状】 GPlates在还原古地理图和计算古坐标点上功能十分卓越,最近在使用它标注某个类群的化石坐标点时,这些点在地图上显示得非常小,让人不易察觉。作为一款优秀的GUI应用,应该具备更改标记点外观的功能,然而在查阅了官方手册,pygplates API后,表明不管是桌面应用还是python接口,都无法简便地修改标记点的外观。在之前GPlates学习和最近的pygplates学习中,印象里有可以改变标记点外观的东西,叫做。当然,这又诱使我翻了一遍资料,然而又没有直接关于symbol的资料。 阅读详情

相关推荐

电力电子论文(TPE、TTE)投稿经验分享

电力电子顶刊论文投稿经验

橙子的博客 2万+

SCIE1000 Semester 2 2024 Python and Communication Python

1000Semester2,2024PythonandPatronTypeTypicalicsScienceRookieNotfamiliarwithornotation;willneedexplainedusingasimplevocabulary;isunfamiliarwithgraphs;maybeayoungerperson,possibly10+years。

ishytynt的博客 1116

【实战指南】OpenClaw 使用 Bird Skill 接入 X(Twitter)的终极省心方案:告别每次都要手动喂 Cookie 的痛苦

OpenClaw 使用 Bird Skill 接入 X(Twitter)的终极省心方案:告别每次都要手动喂 Cookie 的痛苦

hampeter的博客 1803

InnoDB 内存结构总览:Change Buffer、AHI 与 Log Buffer

本文系统梳理InnoDB内存结构中的ChangeBuffer、Adaptive Hash Index(AHI)与LogBuffer。ChangeBuffer缓存二级索引页不在内存时的变更,减少随机IO,仅在页加载时合并;聚簇索引修改立即执行,因数据本身不可延后。AHI基于高频等值查询自动构建哈希索引,加速定位,仅支持等值操作。LogBuffer为redo log内存缓冲,配合磁盘日志实现崩溃恢复。三者均服务于性能优化,其中ChangeBuffer与AHI共享BufferPool空间,而LogBuffer独立

bksczm的博客 310

3、深入了解响应式扩展(Reactive Extensions)

本文深入探讨了响应式扩展(Reactive Extensions,Rx)的起源、核心概念及其在客户端和服务器端的应用。从Volta项目谈起,解析了Rx如何解决事件传输问题,并介绍了可观察对象(IObservable)和观察者(IObserver)的设计与实现机制。文章还详细讲解了Rx操作符、弹珠图的使用、拉模型与推模型的对偶性原理,并通过代码示例展示了如何将枚举转换为可观察对象。最后总结了Rx的优势,并展望其在未来软件开发中的广泛应用前景。

m2n3b4v5c6的博客 113

Python爬虫-爬取汽车之家各品牌周销量榜数据,进行数据分析

本文是该专栏的第57篇,后面会持续分享python爬虫干货知识。本文中,笔者已经整理20篇汽车平台相关的爬虫项目案例。对此感兴趣的同学,可以直接翻阅查看。同样,笔者在本文中将继续以汽车之家平台为例子。基于Python爬虫,实现批量爬取“各品牌周销量榜单”的数据。废话不多说,具体实现思路和详细逻辑,笔者将在正文结合完整代码进行详细介绍。接下来,跟着笔者直接往下看正文详细内容。(附带完整代码)

Python进阶专栏《爬虫实战进阶》,《Pyppeteer从入门到精通》原创作者 366

信创环境下PageOffice文档控件适配与实践

信创适配做到文档控件这一层,拼的已经不是"有没有国产版本",而是同一个功能在两类终端上是否真的等价。等价的标准很具体:同一次点击能得到同样的结果,同一份公文能得到同样的版式,同一个项目不需要维护两套代码。这背后是三件并不轻松的工作:服务端用一套接口同时支撑两类终端,客户端把两种系统与四种芯片的安装包分发清楚,文档内核层由产品侧跟着 WPS 的版本走。浏览器这一层的压力,则被收进了产品自己的窗口里——升级节奏由产品掌握,不再交给运气。

zi_wu_xian的专栏 336

微信小程序数据采集实战:抓包+接口分析+动态数据全流程

微信小程序爬虫虽然比普通网页爬虫复杂,但只要掌握了正确的方法,其实并没有想象中那么难。核心思路就是:先绕过证书校验抓包,然后反编译小程序找到加密逻辑,最后用Python模拟相同的加密和解密过程。需要特别提醒的是,本文仅供技术研究使用。请遵守《网络安全法》和相关法律法规,不要爬取他人的敏感数据,不要将爬虫技术用于非法用途。尊重他人的知识产权和数据安全,才能让技术发挥真正的价值。

专注于Python爬虫开发,分享爬虫技巧、项目实战与反爬经验,使用Scrapy、BeautifulSoup等工具,解决数据抓取难题。 1096

第三篇 第 6 课

前置:第三篇第 1 课(stdx 引入),第二篇第 1 课(std.regex)。环境:仓颉 SDK 1.2.0。本文所有代码与输出均逐行实测。

weixin_41618057的博客 557

ZYNQ工业级串口方案:AXI UART 16550扩展RS-485实战(自动方向控制+Linux驱动)

可以轻松扩展出多路工业级串口。但常规方案需要手动控制收发方向(DE/RE引脚),存在实时性差、CPU占用高等痛点。本文从硬件逻辑设计到Linux驱动开发,完整实现了ZYNQ平台的RS-485工业通信方案。,解决了传统方案实时性差的痛点。所有代码均经过实际项目验证,可直接用于生产环境。:尝试将此设计扩展为多协议兼容接口(支持RS-422/RS-232切换)!等特性,依然是现场总线通信的首选。,通过硬件逻辑+Linux驱动协同设计,实现零延迟切换。在工业自动化、能源电力等场景中,RS-485凭借。

QQ_778132974的博客 832

地平线旭日X3开发板--使用Opencv显示CSI摄像头例程

但是从libsrcampy获取的摄像头图像格式是NV12,无法直接在opencv上显示或者处理,调试过程发现旭日派无法直接用opencv的VideoCapture()调用CSI摄像头,需要使用opencv来做开发的小伙伴可以做个参考,效果如下图所示。需要使用libsrcampy库来获取CSI摄像头图像,为了能够使用opencv的API来处理图像,需要增加NV12转化成bgr像素格式的函数。opencv显示图像.png。

bingdund的博客 543

【从零理解 Spring AI · 12】MCP 的两种角色:做客户端还是做服务端

上一篇讲了 MCP 的概念:标准协议、三大角色、M+N 替代 M×N。

nice_lcj520的博客 616

EMC设计技巧及经验总结3:TVS的使用

Way back in undergrad circuits class(回到本科时的电路课程), our TA(助教) loved to give uslittle “black box” circuits. We’d measure the voltage and current characteristics, then have to determine what compone

snmplink的博客 2411

pcl2启动器下载(Minecraft PCL2 启动器 最新版 安装与使用说明)

摘要:PCL2(Plain Craft Launcher 2)是一款面向 Minecraft 的第三方启动器,支持正式版与快照版本管理、模组与整合包安装、Java 运行时自动匹配,绿色免安装、双击即可运行。适合在 Windows 上玩单机整合包、需要多版本共存或离线启动的用户使用

2611_96675819的博客 226

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

visio安装包

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

spring boot 4集成SQLLite,及其SQLLite的建库

spring boot 4集成SQLLite,及其SQLLite的建库

weixin_41463944的博客 239

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

Java 集合容器高频面试题全解:HashMap 树化阈值、1.7 死循环与 ConcurrentHashMap 演进(2026 招聘 JD 真题复盘)

HashMap 树化阈值 8 的泊松分布依据、退化阈值 6 的防抖设计、JDK 1.7 头插成环死循环的排查与修复、1.8 尾插后为何仍线程不安全、ConcurrentHashMap 放弃分段锁的原因与 ForwardingNode 协作扩容、computeIfAbsent 死锁陷阱、大集合找重复的场景题选型,附三层追问链自测。题目来源为 38 期公开招聘 JD 样本与字节、拼多多、建行、美团、快手公开面经。

蒙眼过河 427

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

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

spdlog 同步日志库使用详解

spdlog是一个轻量级 C++ 日志库,支持同步日志、异步日志、多线程日志、日志文件轮转和自定义日志格式。对于嵌入式 Linux 应用开发,我建议先使用。它可以帮我们完成:日志级别过滤。时间戳和线程 ID 输出。日志格式化。终端和文件输出。多线程安全写入。日志文件按大小或时间轮转。我们不需要自己实现互斥锁、文件写入、日志格式化和轮转等底层功能。

zengjiajun2006的博客 1124

JavaSE通关手册:数据类型与变量

代码无需额外处理,编译时编译器自动完成转换。

xys_678的博客 236

IDEA 简介:从零认识 IntelliJ IDEA

IDEA 全称,是由 JetBrains 公司开发的一款主流 Java 集成开发环境(IDE)。它集代码编辑、编译、调试、测试、版本控制、构建管理等功能于一体,被大量 Java 开发者视为日常开发的首选工具。所谓 IDE(Integrated Development Environment,集成开发环境),就是把写代码所需的各类工具整合到同一个界面中。相比只用文本编辑器加命令行编译,IDE 能显著减少重复操作,让开发者把精力集中在业务逻辑上。

ztI10的博客 187

Docker部署linkding:HTTPS与数据备份

部署私人书签库,除了让页面能够打开,还需要考虑几个实际问题:重建容器后数据是否保留、登录和保存是否正常、升级前怎样备份,以及出现 502 或 CSRF 错误时从哪里检查。本文使用 Docker Compose 部署 linkding,采用默认 SQLite 数据库,通过 Caddy 提供 HTTPS,并完成账户创建、数据持久化验证和备份。如果重建后账户或书签消失,应先检查是否换了项目目录、改了挂载路径,或者启动了另一套实例,不要急着重新初始化。遇到权限问题,应根据日志确认具体目录和运行用户,再调整权限。

tedcloud123的博客 194

动态代理两大流派:JDK 代理与子类代理

业务类想加日志,最直白的写法是侵入式修改: 问题很明显:每个方法都要改一遍,改一个业务要动十处。代理模式的解法是:调用方不直接依赖 ,而是依赖一个代理对象。代理对象长得跟目标一模一样,调用它 → 代理先执行增强逻辑 → 再转调真实对象。 关键在于:代理对象的类型是哪来的?这就是"动态"二字的含义:代理类在运行时才诞生。两个角色: 承载增强逻辑, 负责生成代理类。 组装代理并调用: 输出: 业务代码 一行没动,增强逻辑全在 里。这就是 AOP 的味道。 内部四步: 第 2 步 内部:先查 (同一个接口

Android的专栏 663

C++20协程怎么运行?原理与三大核心组件深度剖析

C++20协程是轻量级的无栈状态机,通过co_await、co_yield、co_return实现挂起与恢复,由Promise、协程句柄和Awaitable三大组件协同工作。协程与线程互补,适用于高效管理大量并发I/O任务,显著降低上下文切换开销。其核心在于编译器生成的状态机机制,需配合库(如cppcoro)使用。掌握Promise控制逻辑、句柄生命周期管理及Awaitable语义,是构建高性能异步程序的基础。

Lucis__的博客 336

c++ explicit关键字详解

explicit。

拒绝AI文,努力在AI时代写出感动人心的好文章 170

TRingBuffer两端都能增删(快递站版)

TRingBuffer 是一个支持两端增删、下标访问且容量动态增长的环形双端队列。它通过无符号索引的永不归零设计,利用减法自动模运算实现空满判断与元素计数,避免了传统环形缓冲浪费格子的问题。内部以票号(索引)标记首尾,扩容时重排元素为连续存储,保证 O(1) 操作与高缓存效率。虽不线程安全,但其高效性使其成为游戏开发中事件队列、命令缓冲等场景的理想选择。

u013768914的博客 315

Teamcenter Java SOA 开发:连接、查询与保存

本文介绍如何通过 Java 调用 Teamcenter SOA 接口实现外部系统对接,涵盖连接登录、查询保存等核心操作。以最小闭环示例展示 Connection、Service、ModelObject 等关键组件的使用,强调错误处理与事务管理要点。梳理了 DataManagement、Query、File Management 等 API 模块分工,并结合“工作移交WebService”案例,说明幂等性设计与流程状态返回的重要性。适用于 Web 门户、ERP 集成等场景,建议批量操作用 bulk 接口优化性

软件工程师文艺 277
上一篇: CITS2402 Introduction to Data Science
下一篇: ITMF7.120 Mechatronics in IT
WX_codehelp
博客等级 码龄2年 700粉丝 87原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值