首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
代做CAP 4611、代写C/C++,Java程序
项目预算:
开发周期:
发布时间:
要求地区:
Final Exam
Instructor: Amrit Singh Bedi
Instructions
This exam is worth a total of 100 points. Please answer all questions clearly
and concisely. Show all your work and justify your answers.
• For Question 1 and 2, please submit the PDF version of your solution
via webcourses. You can either write it in latex or do it on paper and
submit the scanned version. But if you do it on paper and scan it,
you are responsible for ensuring it is readable and properly scanned.
There will be zero marks if it is not clearly written or scanned.
• The total time to complete the exam is 24 hours and it is due at 4:00
pm EST, Friday (April 25th, 2025). This is a take-home exam. Please
do not use AI like ChatGPT to complete the exam. There are zero
marks if found (believe me, we would know if you use it).
Question 1 50 marks
Context: In supervised learning, understanding the bias-variance tradeoff
is crucial for developing models that generalize well to unseen data.
Problem 1 10 marks
Define the terms bias, variance, and irreducible error in the context of su pervised learning. Explain how each contributes to the total expected error
of a model.
1
Problem 2 20 marks
Derive the bias-variance decomposition of the expected squared error for a
regression problem. That is, show that:
ED,ε[(y − f
ˆ(x))2
] = Bias[f
ˆ(x)]
2
+ Var[f
ˆ(x)] + σ
2
where f
ˆ(x) is the prediction of the model trained on dataset D, y = f(x)+ε,
and σ
2
is the variance of the noise ε.
Hint: You can start by taking y = f(x) + ε, where E[ε] = 0, and
Var[ε] = σ
2
. Let f
ˆ(x) be a learned function from the training set D. Then
proceed towards the derivation.
Problem 3 10 marks
Consider two models trained on the same dataset:
• Model A: A simple linear regression model.
• Model B: A 10th-degree polynomial regression model.
Discuss, in terms of bias and variance, the expected performance of each
model on training data and unseen test data. Which model is more likely
to overfit, and why?
Problem 4 10 marks
Explain how increasing the size of the training dataset affects the bias and
variance of a model. Provide reasoning for your explanation. (10 marks)
Question 2: Using Transformer Attention 50
marks
Context. Consider a simplified Transformer with a vocabulary of six to kens:
• I (ID 0): embedding 1.0, 0.0
• like (ID 1): embedding 0.0, 1.0
• to (ID 2): embedding 1.0, 1.0
2
• eat (ID 3): embedding 0.5, 0.5
• apples (ID 4): embedding 0.6, 0.4
• bananas (ID 5): embedding 0.4, 0.6
All three projection matrices are the 2 × 2 identity:
WQ = WK = WV = I2.
When predicting the next token, the model uses masked self-attention: the
query comes from the last position, while keys and values come from all
previous tokens. (Note: show step by step calculation for all questions
below)
(a) (10 marks) For the input sequence [I, like, to] (IDs [0, 1, 2]),
compute the query, key and value vectors for each token.
(b) (15 marks) Let Q be the query of the last token and K, V the keys
and values of all three tokens.
• Compute the row vector of raw attention scores qK⊤, where q is
the query of the last token and K is the 3×2 matrix of keys. .
• Scale by √
dk (with dk = 2) and apply softmax to obtain attention
weights.
• Compute the context vector as the weighted sum of the values.
(c) (15 marks) Given the context vector c ∈ R
2
from part (b), com pute the unnormalized score for each vocabulary embedding via c ·
embed(w), i.e. dot-product.
• Apply softmax over these six scores to get a probability distribu tion.
• Which token has the highest probability? [Note: Because the six
embeddings are synthetic and not trained on real text, the token
that receives the highest probability may look ungrammatical in
normal English; this is an artifact of the toy setup.]
(d) (10 marks) Explain why the model selects the token you found in
(c). In your answer, discuss:
• How the attention weights led to that choice.
• Explain why keys/values may include the current token but never
future tokens .
3
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代做ecet 35901 computer base...
2025-06-07
代做beco011 economics for bu...
2025-06-07
代写data9001 fundamentals of...
2025-06-07
代写econ 4465 public economi...
2025-06-07
代做module 4: organizing for...
2025-06-07
代做fit9137 assignment 3调试...
2025-06-07
代写sola 5053: assignment 1 ...
2025-06-07
代写st337 and st405 bayesian...
2025-06-07
代写15-122: principles of im...
2025-06-07
代做etb1100 a regression ana...
2025-06-07
代做eb3891 research methods ...
2025-06-07
代做minimalism test 2代做pyt...
2025-06-07
代写st3370 bayesian forecast...
2025-06-07
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!