首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
COMP0197代写、Python程序设计代做
项目预算:
开发周期:
发布时间:
要求地区:
COMP0197 CW1
1
COMP0197: Applied Deep Learning
Assessed Component 1 (Individual Coursework) 2023-24
Submission before 16:00 (UK time), 21st March 2024 (subject to change), on Moodle
Introduction
This is the first of two assessed coursework. This coursework accounts for 50% of the module with three
independent tasks, and for each task, a task script needs to be submitted with other supporting files and
data. No separate written report is required.
There are hyperlinks in the document for further reference. Throughout this document, various parts of
the text are highlighted, for example:
The aim of the coursework is to develop and assess your ability a) to understand the technical and
scientific concepts behind deep learning theory and applications, b) to research the relevant methodology
and implementation details of the topic, and c) to develop the numerical algorithms in Python and one of
the deep learning libraries TensorFlow and PyTorch. Although the assessment does not place emphasis
on coding skills and advanced software development techniques, basic programming knowledge will be
taken into account, such as the correct use of NumPy arrays, tensors – as opposed to, for example,
unnecessary for-loops, sufficient commenting and consistent code format. Up to [20%] of the relevant
marks may be deducted for substandard programming practice.
Do NOT use this document for any other purposes or share with others. The coursework remains UCL
property as teaching materials. You may be risking breaching intellectual property regulations and/or
academic misconduct, if you publish the details of the coursework or distribute this further.
Conda environment and Python packages
No external code (open-source or not) should be used for the purpose of this coursework. No other
packages should be used, unless specified and installed within the conda environment below. This will be
assessed by running the submitted code on the markers’ computers, within a conda environment created
as follows, for either TensorFlow or PyTorch. Make sure your OS is up-to-date to minimise potential
compatibility issues.
conda create -n comp0197-cw1-tf pillow=10.2 pip=19.3 && conda activate comp0197-cw1-tf && pip
install tensorflow==2.13
conda create -n comp0197-cw1-pt -c pytorch python=3.12 pytorch=2.2 torchvision=0.17
Class names are highlighted for those mandatory classes that should be found in your submitted code.
Function names are highlighted for those mandatory functions that should be found in your submitted
code.
Printed messages on terminal when running the task scripts.
Visualisation saved into PNG files with task scripts.
[5]: square brackets indicate marks, with total marks being 100, for 50% of the module assessment.
“filepath.ext”: quotation marks indicate the names of files or folders.
commands: commands run on bash or Python terminals, given context.
COMP0197 CW1
2
Use one of the two for your coursework and indicate with your submitted folder name, “cw1-tf” or “cw1-
pt”. Use the command conda list -n comp0197-cw1-xx to see the available libraries for this coursework
(“xx” is either “tf” or “pt”). You can choose to use either TensorFlow or PyTorch, but NOT both of them in
this coursework, as it is designed to have a balanced difficulties from different tasks. [100%] of the
relevant marks may be deducted for using external code.
Working directory and task script
Each task should have a task folder, named as “task1”, “task2” and “task3”. A Python task script should
be a file named as “task.py”, such that the script can be executed on a bash terminal when the task folder
is used as the current/working directory, within the conda environment described above:
python task.py
It is the individual’s responsibility to make sure the submitted task scripts can run, in the above-specified
conda environment. If using data/code available in module tutorials, copies or otherwise automated links
need to be provided to ensure a standalone executability of the submitted code. Care needs to be taken
in correct use of relative paths, as it was found to be one of the most common issues in the past. Jupyter
Notebook files are NOT allowed. Up to [100%] of the relevant marks may be deducted if no runnable task
script is found.
Printing and visualisation
Summarising and communicating your implementation and quantitative results is being assessed as part
of the module learning outcome. Each task specifies relevant information and messages to be printed on
terminal, which may contain description, quantitative summary and brief remarks. The printed messages
are expected to be concise, accurate and clear.
When the task requires visualising results (usually in the form of image), the code should save the results
into a PNG file in the respective working directory. These PNG files should be submitted with the code,
although they can be generated by the code as well. Please see examples in the module repository using
Pillow. Please note that matplotlib cannot be used in the task scripts but may be a good tool during
development. Up to [50%] of the relevant marks maybe deducted if this is not followed.
Design your code
The functions/classes/files/messages highlighted (see Introduction) are expected to be found in your
submitted code, along with the task scripts. If not specifically required, you have freedom in designing
your own code, for example, data type, variables, functions, scripts, modules, classes and/or extra results
for discussion. These will be assessed for complementing your work but not for design aspects.
The checklist
This is a list of things that help you to check before submission.
✓ The coursework will be submitted as a single “cw1-xx” folder, compressed as a single zip file.
✓ Under your “cw1-xx” folder, you should have three subfolders, “task1”, “task2” and “task3”.
✓ The task scripts run without needing any additional files, data or customised paths.
✓ All the classes and functions colour-coded in this document can be found in the exact names.
✓ Check all the functions/classes have a docstring indicating a brief description of its purpose,
together with data type, size and what-it-is, for each input argument and output.
COMP0197 CW1
3
Task 1 Stochastic Minibatch Gradient Descent for Linear Models
• Implement a polynomial function polynomial_fun, that takes two input arguments, a weight vector 𝐰
of size 𝑀 + 1 and an input scalar variable 𝑥, and returns the function value 𝑦. The polynomial_fun
should be vectorised for multiple pairs of scalar input and output, with the same 𝐰. [5]
𝑦 = ∑ 𝑤𝑚𝑥
𝑚
𝑀
𝑚=0
• Using the linear algebra modules in TensorFlow/PyTorch, implement a least square solver for fitting
the polynomial functions, fit_polynomial_ls, which takes 𝑁 pairs of 𝑥 and target values𝑡 as input, with
an additional input argument to specify the polynomial degree 𝑀, and returns the optimum weight
vector 𝐰̂ in least-square sense, i.e. ‖𝑡 − 𝑦‖
2
is minimised. [5]
• Using relevant functions/modules in TensorFlow/PyTorch, implement a stochastic minibatch gradient
descent algorithm for fitting the polynomial functions, fit_polynomial_sgd, which has the same input
arguments as fit_polynomial_ls does, with additional two input arguments, learning rate and
minibatch size. This function also returns the optimum weight vector 𝐰̂. During training, the function
should report the loss periodically using printed messages. [5]
• Implement a task script “task.py”, under folder “task1”, performing the following: [15]
o Use polynomial_fun (𝑀 = 2, 𝐰 = [1,2,3]
T
) to generate a training set and a test set, in the
form of respectively and uniformly sampled 20 and 10 pairs of 𝑥, 𝑥𝜖[−20, 20], and 𝑡. The
observed 𝑡 values are obtained by adding Gaussian noise (standard deviation being 0.5) to 𝑦.
o Use fit_polynomial_ls (𝑀𝜖{2,3,4}) to compute the optimum weight vector 𝐰̂ using the
training set. For each 𝑀, compute the predicted target values 𝑦̂ for all 𝑥 in both the training
and test sets.
o Report, using printed messages, the mean (and standard deviation) in difference a) between
the observed training data and the underlying “true” polynomial curve; and b) between the
“LS-predicted” values and the underlying “true” polynomial curve.
o Use fit_polynomial_sgd (𝑀𝜖{2,3,4}) to optimise the weight vector 𝐰̂ using the training set.
For each 𝑀, compute the predicted target values 𝑦̂ for all 𝑥 in both the training and test sets.
o Report, using printed messages, the mean (and standard deviation) in difference between the
“SGD-predicted” values and the underlying “true” polynomial curve.
o Compare the accuracy of your implementation using the two methods with ground-truth on
test set and report the root-mean-square-errors (RMSEs) in both 𝐰 and 𝑦 using printed
messages.
o Compare the speed of the two methods and report time spent in fitting/training (in seconds)
using printed messages.
• Implement a task script “task1a.py”, under folder “task1”. [10]
o Experiment how to make 𝑀 a learnable model parameter and using SGD to optimise this more
flexible model.
o Report, using printed messages, the optimised 𝑀 value and the mean (and standard deviation) in
difference between the model-predicted values and the underlying “true” polynomial curve.
Task 2 A depth-wise separable convolution
For the purpose of the coursework, the dataset is only split into two, training and test sets.
COMP0197 CW1
4
• Adapt the Image Classification tutorial to use a different network, VisionTransformer. You can choose
any configuration that is appropriate for this application. [5]
o TensorFlow version
o PyTorch version
• Implement a data augmentation class MixUp, using the mixup algorithm, such that: [10]
o Inherited from the relevant classes in TensorFlow/PyTorch is recommended but not assessed.
o The MixUp algorithm can be applied to images and labels in each training iteration.
o Have an input flag “sampling_method” and appropriate hyperparameters for two options:
▪ sampling_method = 1: λ is sampled from a beta distribution as described in the paper.
▪ sampling_method = 2: λ is sampled uniformly from a predefined range.
▪ The algorithm should be seeded for reproducible results.
o Visualise your implementation, by saving to a PNG file “mixup.png”, a montage of 16 images
with randomly augmented images that are about to be fed into network training.
o Note: the intention of this task is to implement the augmentation class from scratch using
only TensorFlow/PyTorch basic API functions. Using the built-in data augmentation classes
may result in losing all relevant marks.
• Implement a task script “task.py”, under folder “task2”, completing the following: [15]
o Train a new VisionTransformer classification network with MixUp data augmentation, for
each of the two sampling methods, with 20 epochs.
o Save the two trained models and submit your trained models within the task folder.
o Report the test set performance in terms of classification accuracy versus the epochs.
o Visualise your results, by saving to a PNG file “result.png”, a montage of 36 test images with
printed messages clearly indicating the ground-truth and the predicted classes for each.
Task 3 Ablation Study
Using the Image Classification tutorial, this task investigates the impact of the following modification to
the original network. To evaluate a modification, an ablation study can be used by comparing the
performance before and after the modification.
• Difference between training with the two λ sampling methods in Task 2.
• Implement a task script “task.py”, under folder “task3”, completing the following: [30]
o Random split the data into development set (80%) and holdout test set (20%).
o Random split the development set into train (90%) and validation sets (10%).
o Design at least one metric, other than the loss, on validation set, for monitoring during
training.
o Train two models using the two different sampling methods.
o Report a summary of loss values, speed, metric on training and validation.
o Save and submit these two trained models within the task folder.
o Report a summary of loss values and the metrics on the holdout test set. Compare the results
with those obtained during development.
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代写dts207tc、sql编程语言代做
2024-12-25
cs209a代做、java程序设计代写
2024-12-25
cs305程序代做、代写python程序...
2024-12-25
代写csc1001、代做python设计程...
2024-12-24
代写practice test preparatio...
2024-12-24
代写bre2031 – environmental...
2024-12-24
代写ece5550: applied kalman ...
2024-12-24
代做conmgnt 7049 – measurem...
2024-12-24
代写ece3700j introduction to...
2024-12-24
代做adad9311 designing the e...
2024-12-24
代做comp5618 - applied cyber...
2024-12-24
代做ece5550: applied kalman ...
2024-12-24
代做cp1402 assignment - netw...
2024-12-24
热点标签
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
软件定制开发网!