ECON0013: MICROECONOMICS

3天干完6个月的活,Claude把模型搬上AMD 一条挺刺激的消息:Anthropic 给投资人的材料里有一张幻灯片,写着它的 Claude Mythos Preview 只花了大约​,就摸清了怎么让另一个 Claude 模型在 AMD 的 MI355X 上跑起来。同一处还写了个对照数字:过去给一块新芯片做推理适配,通常要几十名工程师、​。3 天对 6 个月,这个比值太扎眼,当天中文互联网上就冒出一堆「英伟达的护城河塌了」的说法。我把能翻到的材料都翻了一遍,越看越觉得,塌掉的那一小块是真的,可塌的位置和很多人想的不一样。 阅读详情


ECON0013: MICROECONOMICS

Answer the question in Part A, and ONE question from Part B.I and ONE question from Part B.II.

This assessment accounts for 60 per cent of the marks for the course. Each question carries an equal

percentage of the total mark.

In cases where a student answers more questions than requested by the assessment rubric, the policy of

the Economics Department is that the student’s first set of answers up to the required number will be the

ones that count (not the best answers). All remaining answers will be ignored. No credit will be given for

reproducing parts of the course notes. The answer to each part of each question should be on at most one

page (for example A.1 has 6 parts and there should be at most 6 pages of answers to this). Any part of

any answer that violates this will be given zero marks.

ECON0013 1 TURN OVER

PART A

You must answer the question in this section.

A.1 (a) An individual lives for two periods, consuming c when young and c when old. He has assets

0 1

worth A at the beginning of the first period and whatever he has not spent at the end of the

period can be carried forward to the second as saving accruing interest at the real rate r. He

has no other source of income. He has no reason to keep resources beyond the end of the

second period so c = (A?c )(1+r).

1 0

He chooses consumption to maximise lifetime utility

U = ν(c )+βν(c )

0 1

where ν(.) is a within-period utility function and β is a preference parameter.

(i) What properties must the function ν(.) have if the weakly preferred sets in the space of c

0

and c are to be convex? How would you interpret the required properties economically?

1

How would you interpret the parameter β?

(ii) Show that he chooses to consume more in the earlier period if and only if β(1+r) < 1.

Interpret this.

(iii) Suppose that within-period utility has the form ν(c) = ?e?c. Find an expression for

the chosen consumption in each period. (You can ignore corner solutions and therefore

consider only cases where c and c are chosen to both be positive.)

0 1

(iv) Show that the lifetime utility achieved will therefore equal

2+r

U = ? e?A(1+r)/(2+r){β(1+r)}1/(2+r).

1+r

Find therefore an expression for the minimum assets A required to sustain a lifetime utility

of at least U.

(b) A firm produces output Q using skilled labour z and unskilled labour z . The production

0 1

technology is summarised by production function

(cid:20) (cid:21)

1 β

Q = ?ln e?z0 + e?z1

1+β 1+β

for z , z ≥ 0. Labour is hired at skilled wage w and unskilled wage w and the firm takes

0 1 0 1

wages as given.

(i) Without explicitly solving the cost minimisation problem, use analogy with the results of

previous parts to explain

A. why the firm chooses to use more skilled than unskilled labour only if w > βw ,

1 0

ECON0013 2 CONTINUED

B. why the firm’s cost function has the form

w +w w

1 0 1

C(Q,w ,w ) = (w +w )Q + (w +w )ln ?w lnw ?w ln

0 1 1 0 1 0 0 0 1

1+β β

and

C. the form of the conditional demand functions for each type of labour.

(Again, you can ignore corner solutions.)

(ii) Is average cost increasing, decreasing or constant in Q? What does this tell you about

whether there are increasing, decreasing or constant returns to scale?

(You can use here the fact that

w +w w

1 0 1

(w +w )ln ?w lnw ?w ln ≤ 0

1 0 0 0 1

1+β β

for all values of w , w and β.)

0 1

(iii) What is the marginal cost for this technology? Discuss the nature of the firm’s output

supply function.

ECON0013 3 TURN OVER

PART B.I

Answer ONE question from this section.

B.I.1 There is a buyer B and a seller S. The seller produces z units of a good at the cost C(z) = czα

(where α ≥ 1). The buyer gets utility U(z,p) = Bzβ?pz (where β < 1) if she consumes z units of

the good and pays p for each unit she buys.

(a) Considerthe followinggame: First thesellersetsthepricepandundertakes toproduce however

many units the buyer wants at that price. Then the buyer decides how many units to buy.

Describe the subgame perfect equilibrium of this game.

(b) Now consider the different game. First the buyer sets the price p and promises to buy all the

units the seller will produce at that price. Then the seller chooses how many units to produce.

Describe the subgame perfect equilibrium of this game and compare it with your answer above.

(c) If the market for the good were competitive what is the buyer’s demand curve and what is the

seller’s supply curve for the good? What would be the outcome if the competitive price were

then set by an external regulator? Explain how this differs from the outcome in both of the

games above.

(d) Describe a Nash equilibrium of the game where the seller moves first that is not a subgame

perfect equilibrium.

ECON0013 4 CONTINUED

B.I.2 A worker is employed by a firm to produce output. If the worker puts in effort there is: probability

p that they produce two units of output, probability q that they produce one unit, and probability

1?p?q that they produce zero units. If the worker does not put in effort these probabilities are:

r, s, 1?r?s respectively. The manager decides to pay the worker u ≥ 0 if two units are produced

v ≥ 0 if only one unit is produced and w ≥ 0 if no units are produced. The worker has a utility

function x2 ?c if she receives the wage x = w,v,u and puts in effort. If she does not put in effort

she has the utility x2, where x = w,v,u . The worker can earn the utility U from working elsewhere.

The manager can sell each unit of the good that the worker produces for a price R.

(a) Supposethatr < pandconsiderthetwocontracts(u,v,w) = (1,1,1)or(u,v,w) = (1/r,0,0)

which does the worker prefer if she puts in low effort? Which one does the worker prefer when

she puts in high effort? Which contract is cheapest for the firm? Explain your results.

(b) The firm decides that it is content with low effort from the worker. Write down and solve a

constrained optimisation that describes the cheapest way for the firm to achieve this. Interpret

what you find. When does the firm make a profit?

(c) Suppose that p = 2r and the firm decides to pay the worker according to the contract u > 0

and v = w = 0. For what values of c,r,p,U is the worker (a) willing to work for the firm and

provide low effort, (b) willing to work for the firm and provide high effort? If the conditions for

case (a) hold what is the most profitable contract for the firm to offer? If the conditions for

case (b) hold what is the most profitable contract?

(d) Discuss what you think an optimal contract would look like in this case (p = 2r). In particular

consider when the firm is willing to pay for high effort from the worker.

ECON0013 5 TURN OVER

PART B.II

Answer ONE question from this section.

B.II.1 Consider an economy in which K firms use labour Lk to produce corn Qk, k = 1,...,K and H

consumers supply labour lh and consume corn ch, h = 1,...,H.

Firms produce according to the technology

(cid:16) (cid:17)

Qk = Aln 1+Lk

where A is a production parameter.

Consumers are potentially of two types. There are H individuals of Type A who have utilities

A

1 (cid:16) (cid:17)2

Uh = ch ? lh

2

whereas there are H = H ?H individuals of Type B who have utilities

B A

1 (cid:16) (cid:17)3

Uh = ch ? lh .

3

Let the price of corn be p and the nominal wage be w so that the real wage expressed in unit of corn

is W = w/p.

Firms choose production plans to maximise profits πk = pQk?wLk taking prices as given. Profits

are distributed as income to consumers according to production shares θhk (where (cid:80)H θhk =

h=1

1 for each k = i,...,K) and consumers maximise utility subject to budget constraints pch =

(cid:80)K θhkπk +wlh taking prices and firm profits as given.

k=1

(a) Find an expression for the labour demand of each firm given W. Hence find each firm’s profit.

(b) Find expressions for the labour supply of each consumer type given W and firm profits.

(c) Suppose all individuals are of type A, H = H and H = 0, that H = K, and that θhk = 1/H

A B

forallhandallk sothatfirmownershipisequallyspread. FindtheuniqueWalrasianequilibrium

real wage W?.

(d) Illustrate the equilibrium on a Robinson Crusoe diagram for the case H = 1 (and explain why

this also represents the more general case H > 1).

(e) How does the equilibrium real wage change if H > K so that there are more workers than

firms? Discuss.

(f) How does the equilibrium real wage change if θhk (cid:54)= 1/H for some h and k so that ownership

is not equally spread? Discuss.

(g) Now suppose that both H > 0 and H > 0 so that the consumer population consists of

A B

individuals of both types. Is the equilibrium still necessarily unique? Either explain why the

equilibrium remains unique or provide an example where it is not.

ECON0013 6 CONTINUED

B.II.2 Individuals in an economy consume n goods q = (q ,q ,...,q )(cid:48), purchased at the prices p =

1 2 n

(p ,p ,...,p )(cid:48) from budgets y. You decide to model behaviour using preferences represented by

1 2 n

the expenditure function c(υ,p) where υ represents consumer utility.

(a) Explain what an expenditure function is and why

?lnc(υ,p)

= w (υ,p) i = 1,2,...,n

i

?lnp

i

where w (υ,p) is a function giving the budget share of the ith good.

i

Suppose that the expenditure function takes the form

lnc(υ,p) = (cid:88) α ilnp

i

+ υe(cid:80) iβilnpi

i

where α = (α ,α ,...,α )(cid:48) and β = (β ,β ,...,β )(cid:48) are vectors of preference parameters.

1 2 n 1 2 n

(b) What homogeneity property must an expenditure function have? Outline a set of restrictions

on α and β which suffice for c(υ,p) to have that property.

(c) Find an expression for the budget shares under these preferences.

Concern is high that recent inflation, under which the prices have changed from p0 to p1, has

aggravated inequality by hitting poorer individuals harder than the more affluent.

(d) Explain what a true or Konu¨s cost-of-living index

K(cid:0) υ,p0,p1(cid:1)

is and show that under these

preferences

lnK(cid:0) υ,p0,p1(cid:1) = (cid:88) α iln pp 01 i + υ(cid:104) e(cid:80) iβilnp1 i ?e(cid:80) iβilnp0 i(cid:105) .

i i

(e) Explain what a Laspeyres cost-of-living index

L(cid:0) υ0,p0,p1(cid:1)

is and show that under these pref-

erences

(cid:40) (cid:41)

lnL(cid:0) υ0,p0,p1(cid:1) = ln (cid:88) α ip p1 i

0

+ υ0(cid:88) β ip p1 i

0

e(cid:80) iβilnp0 i

i i i i

where υ0 denotes utility in the initial period.

(f) Explainwhytheframeworkwhichyouhaveadoptedformodellingbehaviourisusefulforaddress-

ing the question of how inflation aggravates inequality only if preferences are not homothetic.

What must be true of α and β if preferences are not to be homothetic?

(g) What can be said about comparison of the Laspeyres and true indices if preferences are homo-

thetic? What if they are not homothetic?

(h) What aspect of consumer behaviour do the Laspeyres indices fail to account for? Supposing

that preferences are non-homothetic, discuss how this omission might distort judgement of the

distributional effects of inflation.

如何处理动态语言(Python / JS)的“隐形”调用链? 本文揭示动态语言(Python/JS)中静态AST解析导致调用链“断链”的核心问题,提出通过运行时追踪补全图谱的解决方案。基于Code-Graph-RAG的cgr trace机制,分别利用pytest插件与V8 Profiler捕获真实调用路径,将动态边合并至静态图谱,并在权重体系中提升动态边优先级。实践表明,该方法可显著提升图谱覆盖率,实现“结构+行为”双视角理解代码,为MCP与Rerank系统提供可靠支持。 阅读详情

相关推荐

【Get深一度】小波分析概念1——紧支撑集是什么意思,通俗解释

最近学到小波,在仿真中也用到了紧支撑函数;紧支撑性越好,说明能量越集中;用最通俗的话来讲,紧支撑是这样的: 对于函数f(x),如果自变量x在 0附近的取值范围内,f(x)能取到 C; 而在此之外,f(x)取值为 0; 那么这个函数f(x)就是紧支

Trey_优快云 的优快云博客 8350

ECON0013 Microeconomics PART ASPSS

fiΣfi√√√√x?Comment.Comment.

yychendd的博客 527

告别‘Duang’的一声:手把手解决RK3588开发板PCIe初始化卡死问题(DTS修改实战)

本文详细介绍了解决RK3588开发板PCIe初始化卡死问题的完整过程,包括问题诊断、DTS文件修改及编译烧写步骤。通过禁用未使用的PCIe硬件资源,有效解决了启动卡死问题,为嵌入式开发者提供了实用的调试方法和经验总结。

weixin_30753873的博客 219

本地化部署 DeepSeek,构建单细胞与空间转录组 AI 分析平台

本地化部署 DeepSeek,构建单细胞与空间转录组 AI 分析平台

weixin_53637133的博客 187

Vue3 - 手机移动端H5网页强力解决弹起软键盘后页面被挤压变形或页面整体上移问题,点击input输入框键盘弹出底部被上推往上顶遮挡及各种问题(兼容安卓苹果ios手机,微信公众号网页微信内置浏览器)

vue3,h5网页,input输入框组件,vue3 h5软键盘弹出,vue3输入框,键盘弹起时页面整体上移问题,uni,H5页面,解决软键盘弹起页面被挤压、被往顶的问题,解决vue3输入框,键盘弹起时页面整体上移问题,vue3调用手机系统软键盘,页面窗口被顶起,布局定位失效,解决VUE3软键盘弹起导致页面fixed定位元素被顶上去,输入法软键盘弹起,窗口顶起,变形解决办法,Vue中input组件在IOS设备上弹出软键盘时页面整体上移问题的解决方案,以及input组件聚焦后弹出软键盘固定在,Vue3软键盘把界

🏆 前端领域优质创作者 1万+

EtherCAT用TwinCAT 3跑DC报0x2C或者0x1A错误码

EtherCAT用TwinCAT 3跑DC报0x2C或者0x1A DC报错 ///////////////////////////////////////////////////////////////////////////////////////// /** \brief Checks communication and synchronisation variables and update AL status / AL status code if an error has occurr

PI_sunyang的博客 5308

【第 009 讲】全面掌握 Python 注释:注释的定义与作用 | 单行注释 | 三引号与多行注释 | 注释使用的最佳实践

本文系统讲解 Python 注释的完整知识体系:从注释的定义与作用讲起,梳理单行注释的书写位置、临时屏蔽用法与 PEP 8 排版规范,剖析注释被忽略的底层机制;进而说明三引号字符串的本质与嵌套问题;最后给出注释使用的三条实践原则,帮助读者写好可读性高的注释。

大模型全栈工程师 · Thanks_ks 1186

SAP Event Mesh 简介

Get Started with Messaging for Decoupled Communication Step 1: What is the SAP Event Mesh service? SAP Event Mesh 是一种完全托管的服务,用于连接应用程序、服务和系统,以便它们可以通过消息和事件相互交互。 它通过引入中央消息代理取代了传统的点对点通信。 虽然点对点通信适用于在有限数量的发送方和接收方之间共享数据,但可扩展性很快就会成为一个问题。 SAP Event Mesh 解决了这个问题,并确保

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

AI全栈实战 | 3.9-01 爬虫入门:requests 加 BeautifulSoup 三分钟跑通,但 90% 的人栽在这 4 个“礼貌“问题上

⚠️:本文内容仅用于。请遵守目标站点的服务条款与相关法律法规,不得对目标服务造成负担,不得采集、传播个人隐私数据。技术是中性的,边界在你手里。爬虫的入门技术(requests 发请求 + BeautifulSoup 解析)三分钟就能学会。真正区分"会用爬虫"和"会做爬虫的人"的,是这篇我们跑通"请求→解析→存储"的最小闭环,然后重点把"合规与礼貌"这根弦给你绷上。

源码获取 | 运行部署 | 定制二开修改,如果回复不及时请耐心等待,请见谅。 445

高精度导航 | RTK:2025年高精度导航算法综述,包括:原理,数据,公式,完整代码,开源代码链接

中国科学院国家授时中心的最新研究表明,PPP-AR/PPP-RTK增强算法使时间传递链路的稳定性提升超过30%,模糊度固定成功率高达93.57%,首次固定时间缩短至20分钟内。当这一愿景实现,人类社会的生产效率和资源利用率将迎来革命性提升,高精度定位将成为像电力、互联网一样的基础服务,深刻重塑我们的生活方式和文明形态。PPP-RTK作为GNSS定位领域的最前沿技术,成功融合了精密单点定位(PPP)和实时动态定位(RTK)的双重优势。,实现在无GNSS信号环境下(如隧道、地下停车场)的连续厘米级定位。

尘世冰封的专栏 1615

面向非平行语料的语音转换技术综述

摘要语音转换是语音及人工智能领域的一项研究课题,其目标是在保持源语音内容不变的情况下改变语音的音色,使其听上去像是由另一个目标说话人说出的,同时还需保证语音的质量和自然度。面向非平行语料的语音转换技术是当下的热门研究内容,其使用非平行的多说话人语音数据集进行模型训练,能完成多对多以及任意对任意的语音转换。对近年来面向非平行语料的语音转换进行了全面的总结和分析。首先概述了早期面向平行语料的语音转换及其缺陷,然后对当下面向非平行语料的语音转换的各类实现方法进行介绍和对比分析,最后对语音转换技术进行了总结和展望。

qq_61890005的博客 833

Python 的 yield from 到底转发了什么:拆开 send、throw 和那个 return 值

很多人把yield from记成「省一层 for 循环的语法糖」。写和写,结果看着一样,于是就当它只是少敲几个字。这个理解会在三个地方翻车:调用方.send()的值送不进去、子生成器return的值拿不到、异常和close()传不下去。yield from真正做的事是,外层生成器退成一个透明通道。本文所有输出来自本机 CPython 3.13.14 实测。yield from不是循环,是委托——nextsendthrowclose四个方向的流量全部直通子生成器,并且子生成器return。

小小张说故事的博客 164

使用Qt Creator自带的Qt Designer构造UI界面流程总结

在本文中,我们将总结使用Qt Creator自带的Qt Designer构造UI界面的流程。在对话框中,您可以选择一个控件的信号,然后将其连接到另一个控件的槽。例如,您可以将按钮的点击信号连接到一个槽函数,以响应按钮的点击事件。右键单击窗口设计器中的空白区域,选择适当的布局管理器,如水平布局、垂直布局或网格布局。在Qt Designer中,您可以使用各种预定义的UI控件来设计应用程序的界面。现在,您可以在应用程序的源代码中使用生成的UI界面。在您的源文件中,包含相应的头文件,然后创建一个UI界面的实例。

cl6789的博客 1395

从一段视频到可漫游的 4D 有声场景:思路拆解与最小复现手记

只需一段手机视频,你就能生成可"走进去"的 4D 有声场景:转头时狗叫声方向随之变化,走近时声音更清晰。本文拆解 Video-to-4DAVScene 的核心思路,手把手带你用几十行 Python 搭出最小管线,把视频中的运动物体变成带空间位置的声源,并附上三个真实踩坑的排障经验,代码可直接跑。🎧

helloagent的博客 246

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

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

【每天一个 Python 小案例30】Python 基础知识综合小项目:我的工具盒

作为系列收官,本篇把前 29 篇的知识点合成一个能直接用的命令行工具"我的工具盒":计算器(用 ast 解析表达式,不碰 eval)、单位换算与温度转换(一张换算表 + 特例分支)、记账与分类统计(Decimal + JSON 持久化)、以及用"字典当命令表"把菜单和业务逻辑解耦的主循环。文中对比了 eval 的安全隐患与 ast 白名单的做法,解释了 lambda 闭包在字典里的写法与晚绑定陷阱,并在最后给出整个系列的知识地图,把变量、数据结构、控制流、函数、类、异常、文件、标准库八块内容对应到具体篇目。

xinjiyaya的博客 432

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

双路径优化+双容差校准

默认使用向量化路径处理常规数据,当检测到内存非连续或需要极致短路性能时,自动切换至 Numba JIT 路径。“当 CI 宽度中位数为 $W$ 时,实际判定容差为 $10^{-12} + 10^{-9} \times W$"针对表征谱算子 2 的实际输出量纲(例如 $10^{-3}$ 至 $10^3$),调整。准确标记了哪些数组被复制。非短路、静默拷贝风险、量纲耦合容差),本方案重构了核心逻辑。,并完善审计元数据以记录内存拷贝状态。, 确保在不同量纲下判定标准的一致性。,否则需排查上游数据生成逻辑。

2301_77211362的博客 208

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

yolo 和 deft 算法的区别

你应该是打错了:是,不是 defrat;

曾大强博客 290

蓝桥杯·全国青少年信息素养大赛·电子学会Python/C++考级 备考:莫队算法离线区间查询详解

备赛进行时:第十八届蓝桥杯软件赛报名已于 2026-10-08 10:00 开启、12-18 14:00 截止,省赛定在 2027-04-10(C/C++·Python 程序设计 9:00–13:00);中国电子学会 2026 年 12 月软件编程(C/C++ 一级至十级、Python 一级至六级)考级报名 9/23–12/2 16:00、统考 12-12;全国青少年信息素养大赛 2026—2027 赛季算法应用主题赛也已进入复盘练兵窗口。

IT_Scratch的博客 184

两张表合并之后,行数悄悄多了一倍

pandas merge 行数异常膨胀源于右表键不唯一,导致数据静默复制。实测显示,未聚合的右表(756行)与左表合并后行数增至504行,合计膨胀3.5倍,但无报错。validate 参数仅在检查键唯一性时有效,one_to_one 和 many_to_one 可拦截问题,但需结合 duplicated() 前置检查。正确做法为先按键聚合右表,再合并,避免重复。建议合并前后核对行数、合计,并使用 indicator=True 排查匹配情况,确保数据一致性。

patrickstar231的博客 252

我用 200 行代码写了个“代码屎山检测器“,扫完公司的老项目后我沉默了

这个工具不能帮你把屎山铲平,但至少能让你知道自己面对的是多大的山,也能在代码评审时用数据说话——“这个 PR 把圈复杂度从 12 推到了 18,能不能拆一下?毕竟,不能量化的东西,就没法改进。

xixiaoyunya的博客 277

智慧农业实战:育秧车间秧盘计数与苗情分级的Python实现

首先,建立统一的数据结构,保存每盘秧苗的编号、批次、覆盖度、叶色得分和播种天数。A = "壮苗"B = "合格苗"C = "弱苗"@dataclassdays: int。

荆棘鸟智能的博客 138

Java Arrays.asList 常见坑详解|UnsupportedOperationException、数组联动、基本类型 bug

解析 Arrays.asList 常见开发陷阱,演示 UnsupportedOperationException、底层数组引用共享、基本类型数组问题,区分 Arrays 内部 ArrayList 与 java.util.ArrayList,给出数组转 List 的各种场景正确代码。

weixin_42617033的博客 511

【每天一个 Python 小案例29】Python 实现商品购物车

本篇实现一个购物车:商品目录、加入商品、修改数量、移除商品、查看小计、计算满减与 VIP 折扣、结算扣库存。核心设计是"目录与购物车分离"——目录存商品主数据,购物车只存 {商品编号: 数量};金额一律用 Decimal 并做 ROUND_HALF_UP 舍入。折扣部分讲清阶梯满减的匹配顺序(阈值从高到低、命中即停)与叠加顺序(先满减、后打折),并用一次完整结算演示 706 元如何变成 613.70 元。

xinjiyaya的博客 220

Python的字典

Python字典是存储键值对的数据结构,通过键(key)快速查找对应的值(value)。可使用{}定义,支持增删改查操作:通过dict[key]查询或修改值,get()方法安全获取并设置默认值,del dict[key]删除键值对,keys()、values()和items()用于遍历。items()结合双变量循环可高效遍历所有键值对,提升代码可读性与灵活性。

qq_43010954的博客 199
下一篇: Game Start Food Generator
vx_codinghelp
博客等级 码龄2年 543粉丝 68原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值