首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
COM6509程序设计辅导、讲解Python,Java编程、Python编程辅导 辅导Python程序|讲解R语言编程
项目预算:
开发周期:
发布时间:
要求地区:
COM6509 Assignment 2 - Deadline: 11:00 AM, Friday 22nd Jan 2021
Click for FAQ at the bottom of this document.
A. Assignment Brief
Please READ the whole assignment first, before starting to work on it.
A1. How and what to submit
1) A Jupyter Notebook with the code in all the cells executed, output displayed, and
code documented.
2) Upload your notebook to Blackboard before the deadline above. Name your file as
COM6509_Assignment_2_USERNAME.ipynb, where USERNAME should be replaced
with your username such as abc18de
3) NO DATA UPLOAD: Please do not upload the data files used. We have a copy already.
Instead, please use a relative file path in your code (data files under folder ‘data’), as
in the lab notebook so that we can run your code smoothly when needed. So ‘./data/’,
instead of ‘/User/username/myfiles/mlai/assignment1/’
A2. Assessment Criteria (Scope: Sessions 6-8; Total marks: 30)
1) Being able to build complete, reproducible machine learning pipelines from loading data
to evaluating prediction performance.
2) Being able to design different machine learning models to compare/optimise prediction
performance.
3) Being able to perform exploratory data analysis to gain insights.
A3. Late submissions
We follow the Department's guidelines about late submissions, i.e., a deduction of 5% of the
mark each working day the work is late after the deadline, but NO late submission will be
marked one week after the deadline. Please see this link.
A4. Unfair mean
Please carefully review the handbook on what constitutes Unfair Means if not sure.
B. Assignment on Fashion-MNIST [30 marks]
Fashion-MNIST is a dataset of Zalando's article images, with examples shown above. It
consists of a training set of 60,000 examples and a test set of 10,000 examples. Each example
is a 28x28 grayscale image, associated with a label from 10 classes: 0=T-shirt/top; 1=Trouser;
2=Pullover; 3=Dress; 4=Coat; 5=Sandal; 6=Shirt; 7=Sneaker; 8=Bag; 9=Ankle boot. In this
assignment, we will work on this dataset.
● You will make several design choices (e.g. hyperparameters) in this assignment. There are
no “standard answers”. You are encouraged to explore several design choices to settle
down with good/best ones, if time permits.
● The assignment questions specify the tasks and you make your design choices to
complete the tasks. You are free to use scikit-learn or pytorch, batching or no
batching, as long as you can complete the assignment questions.
B1. Reproducibility & readability [2 marks]
Whenever there is randomness in the computation, you MUST set a random seed for
reproducibility. Use your UCard number XXXXXXXXX as the random seed throughout this
assignment. [1 mark]
Answers for each question should be clearly indicated in your notebook, e.g., including question
numbers below in bold such as B2.1a. All code should be clearly documented and explained. [1
mark]
B2. Supervised learning on Fashion-MNIST [16 marks]
We aim to train machine learning models to classify the 10 classes in Fashion-MNIST using the
standard train/test split with decent performance, i.e. much better than the chance level at
worst.
B2.1 Data loading and inspection [2 marks]
a) Use the PyTorch API for Fashion-MNIST to load both the training and test data of
Fashion-MNIST. You may refer to similar procedures in Lab 7 for CIFAR-10.
Preprocessing is NOT required but you are encouraged to explore and use
preprocessing such as those in the torchvision.transforms API. [1 mark]
b) Display at least eight images for each of the 10 classes (8x10=80 images). [1 mark]
B2.2 Evaluation metrics [2 marks]
Keep a record of the four metrics M1-4 below for each of the six models in B2.3 and B2.4:
M1) Training accuracy: the prediction accuracy of the trained model on the training dataset.
M2) Testing accuracy: the prediction accuracy of the trained model on the test dataset.
M3) Training time: the time taken to train the model (i.e. to learn/estimate the learnable
parameters) on the training dataset.
M4) The number of learnable parameters of the model.
B2.3 Logistic regression [4 marks]
If a hyperparameter needs to be set, you are free to choose one that can deliver satisfactory
results for you.
a) Train a logistic regression model on the training set of Fashion-MNIST and test the
trained model on the test set of Fashion-MNIST. Report the four metrics M1 to M 4 and
plot a confusion matrix for predictions on the test data. [2 marks]
b) Train and test a logistic regression model with L1 regularisation as in a). Report M1 to M4
and plot a confusion matrix for predictions on the test data [1 mark]
c) Train and test a logistic regression model with L2 regularisation as in a). Report M1 to M4
and plot a confusion matrix for predictions on the test data [1 mark]
B2.4 Convolutional Neural networks (6 marks)
This question asks you to design various convolutional neural networks (CNNs). Only the
number of convolutional (Conv) layers and the number of fully connected (FC) layers will be
specified below. The CNN in Lab 7 can be a reference but you are free to design other aspects
of the network. For example, you can use other types of operation (e.g. padding), layers (e.g.
pooling, or preprocessing (e.g. augmentation), and you can choose the number of units/neurons
in each layer. Likewise, you may choose the number of epochs and many other settings
according to your accessible computational power. Reminder: there are no standard answers.
a) Design a CNN with two Conv layers and two FC layers. Train and test it as in B2.3a.
Report M1 to M4 and plot a confusion matrix for predictions on the test data. [2 marks]
b) Design a CNN with two Conv layers and five FC layers. Train and test it as in B2.3a.
Report M1 to M4 and plot a confusion matrix for predictions on the test data. [2 marks]
c) Design a CNN with five Conv layers and two FC layers. Train and test it as in B2.3a.
Report M1 to M4 and plot a confusion matrix for predictions on the test data. [2 marks]
B2.4 Performance comparison (2 marks)
a) Summarise each of the four metrics from the six models in B2.3 and B2.4 using a bar
graph. In total, four bar graphs need to be generated and displayed, one for each metric
with six results from B2.3 and B2.4. [1 mark]
b) Describe at least two observations interesting to you. [1 mark]
B3. Unsupervised learning on Fashion-MNIST [12 marks]
Choose two out of the 10 classes according to your preference and use only the training data
for these two chosen classes to complete all tasks in this section B3. It will be better to finish
reading the remaining part of this section before choosing the two classes. Again, you may
choose any two and there is no “correct” answer about which two to choose but some choices
may make your studies below more interesting than others.
B3.1 PCA and k-means [7 marks]
a) Apply PCA to all images of these two chosen classes. Visualise the top 24 eigenvectors
as images and display them in the order of descending corresponding values (the one
corresponding to the largest eigenvalue first). [2 marks]
b) Use the top 24 PCs to reconstruct 30 images, with 15 from each class (any 15 images
are fine from each class). Compute and report the mean squared error between the
reconstructed and original images for these 30 images (a single value to be reported).
Show these 30 pairs of reconstructed and original images. [2 marks]
c) Plot the PCA representations of all data points in a 2D plane using the top two PCs. Use
different colours/markers for the two classes for better visualisation (Hint: You need to
use the class labels here for visualisation). [2 marks]
d) Use k-means to cluster all data points as represented by the top two PCs (clustering of
two-dimensional vectors, where each vector has two values, PC1 and PC2). Visualise
the two clusters with different colours/markers and indicate the cluster centers clearly
with a marker in a figure similar to question c) above. [1 mark].
B3.2 AutoEncoder [4 marks]
a) Design a new autoencoder with five Conv2d layers and five ConvTranspose2d layers.
You are free to choose the activation functions and settings such as stride and padding.
Train this new autoencoder on all images of these two chosen classes for at least 20
epochs. Plot the mean squared error against the epoch. [2 marks]
b) Modify the autoencoder in 3.2a so that the code (bottleneck) has a dimension of 2 only.
Plot the 2-dimensional representations in terms of this autoencoder code for all data
points in a 2D plane as in 3.1c and cluster them as in 3.1d, showing similar colour/marker
visualisation. [2 marks]
B3.3 Observation [1 marks]
Describe at least two observations interesting to you from B3.1 and B3.2 above.
The END of Assignment
C. FAQ or further clarification
1. The questions mean what they ask. When B2.2. M1 says to report accuracy on the
training set. It means the training set. When B3 says to use only the training data. It
means to use only the training set for B3.
2. Lab 7 CNN has three FC layers fc1, fc2 and fc3. Another example explicitly states this
is slide 35 of lecture6 about AlexNet, which has three fc layers too.
3. You can use Seaborn for plotting the confusion matrix. See an example in my
previous year's Lab 8 notebook (on Naive Bayes).
4. Data conversion between pytorch and numpy: see "Converting NumPy Array to Torch
Tensor" and "Converting a Torch Tensor to a NumPy Array" in pytorch tensor tutorial
5.
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代写math 1151, autumn 2024 w...
2024-11-14
代做comp4336/9336 mobile dat...
2024-11-14
代做eesa01 lab 2: weather an...
2024-11-14
代写comp1521 - 24t3 assignme...
2024-11-14
代写nbs8020 - dissertation s...
2024-11-14
代做fin b377f technical anal...
2024-11-14
代做ceic6714 mini design pro...
2024-11-14
代做introduction to computer...
2024-11-14
代做cs 353, fall 2024 introd...
2024-11-14
代做phy254 problem set #3 fa...
2024-11-14
代写n1569 financial risk man...
2024-11-14
代写csci-ua.0202 lab 3: enco...
2024-11-14
代写econ2226: chinese econom...
2024-11-14
热点标签
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
软件定制开发网!