首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
COMP3611程序辅导、Python语言编程调试、讲解program设计程序 调试Matlab程序|讲解数据库SQL
项目预算:
开发周期:
发布时间:
要求地区:
Machine Learning
COMP3611
Coursework: Supervised Learning and Neural Networks
This coursework comprises 10% of the marks for this module.
Deadline: 27/11/2020 at 23:59 PM, by electronic submission in Minerva.
Implement the following specification in Python. Submit a single zip file, containing exactly two
files, the Python code, and a pdf report.
The report must document your process and show the results, as specified in each section.
Introductions
The Fashion-MNIST dataset is a dataset of Zalando articles’ images. It is composed of 70000
grayscale images of different fashion products, and their correspondent labels. For each category
of fashion item there are thousands of images.
Prerequisite
In this Coursework you will design and train Artificial Neural Networks (ANNs) to perform image
recognition of fashion items.
In order to run the code necessary for this coursework, you need to install the following packages:
• numpy
• sklearn
• matplotlib
• tensorflow==1.5
• keras
Once the installation is completed, run the provided Python script “CW_START.py”, which will
display the first 20 images and labels of the dataset you will use for this coursework.
The dataset is loaded as a Training/Validation set (60 000 images and labels) and a Test set (10
000 image and labels). We will then further split the Training/Validation set into a Training set and a
Validation set.
Design of an ANN with Keras
One of the most important tasks in the design of an Artificial Neural Network is finding a good
starting architecture. This is usually a trial-and-error process, as there exist no general procedure
for approaching this problem.
You are going to use Keras (https://keras.io/), one of the most popular libraries for the design of
Deep Artificial Neural Networks. You will find the description of the basic parts of this library, which
you will use for your exercises, in the next sections of this coursework. Nonetheless, feel free to
consult the official documentation at the link above.
The type of data from that we want our ANN to learn is usually the best starting point for this
design, together with the type of computation we would like to perform.
Conv2D
The most popular solutions in image processing, for feature-extraction purposes, are the
Convolutional Neural Networks. These can be easily designed by using different instances of
Keras.layers.Conv2D which implements 2D convolutional layers. Here is a simplified example of
use:
Conv2D(filters=32, kernel_size=(3, 3), activation='relu',input_shape=(28,28,1), padding='same')
• Filters is the number of outputs we want to give to this specific layer.
• Kernel_size are the two integers specifying the dimension of the kernel matrix. This is also
our matrix of trainable weights for this layer.
• Activation is the activation function we want to use in our artificial neurons and ‘relu’ is one
of the most popular ones.
• Input_shape the shape of the input to this layer. It is usually a matrix whose last element is
the channel dimension which in our case cane be set to 1. This should be set up only if the
Conv2D layer is the input layer.
• Padding is the type of padding we want to apply to the output of our convolutional layer. It
can be left to ‘same’.
MaxPooling2D
Convolutional layers are usually followed by a downsampling step, which can be performed
through keras.layers.MaxPooling2D.
MaxPooling2D(pool_size=(2, 2), padding='same')
• Pool_size are two integers that specify the dimension of the downscaling.
• Padding is the type of padding we want to apply to the output of our convolutional layer. It
can be left to ‘same’.
Dropout
One of the main problems when using function approximators is balancing the neural network
architecture in such a way that it does not overfit the data. Usually this is guaranteed through the
usage of a Validation set, but with big architectures, often, this is not enough. One powerful and
broadly used technique is the dropout. This is simply about randomly deactivating (setting to 0) a
certain fraction of the weights of the network at learning time. In Keras, this is possible using
keras.layers.Dropout.
Dropout(rate=0.01)
• Rate is the percentage of input values to this layer that will be set to zero at each learning
step, that is, they will not contribute to the computation of the output of this layer.
The combination of these three Keras layers is able to perform a robust feature extraction
exploiting the power of Convolutional Neural Networks. Sometimes this is not enough and you
could want to pass through a further Convolutional unit.
Once the feature extraction is designed, we want a Multi-layer Perceptron (MLP) to elaborate the
features and perform the classification.
Flattening
The first step to elaborate the extracted features is making them available to an MLP. The output of
the convolutions is an activation layer, which is a matrix. An MLP, however, processes onedimensional
inputs. In order to give the activation layers as input to the MLP we need to stretch
them into a single (long) vector with: keras.layers.Flatten.
Dense Layers
We are now ready to design our MLP for classification. In order to create one layer of such an
architecture, you can use keras.layers.Dense.
Dense(units=32, activation='relu')
• Units is the number of neurons in the layer.
• Activation is the activation function of the neurons, and ‘relu’ is one of the most popular
ones (we saw another one that was easy to differentiate in class: the sigmoid).
As in the convolutional case, after a dense layer we might want to use a keras.layers.Dropout layer
in order to be robust against overfitting.
Question 1
Start by opening the given CW_START.py. You will find an initial Neural Network architecture
developed in Keras following the instructions above.
Launch the training of the given ANN.
1.a: Add to the report the plot of the accuracy and loss over time that the code generates, and
comment on the result. Is the loss converging on training and validation? Is the network overfitting?
[4 marks]
1.b: Experiment with different learning rates and report on their effect on the loss over the training
and validation data. Identify three values of the learning rate, such that one is too high, one is too
law, and the third one is the one that you consider most appropriate. Include the corresponding
plots in the report, with a comment on the effect of the learning rate on the graphs.
[6 marks]
Question 2
For the second problem you need to modify the current architecture. We propose some possible
modifications you should test yourself, in order to select the architecture that you consider best:
• In Conv2D layers: change the dimension of the filter.
• In Conv2D layers: change the number of filters.
• Change the dropout value in Dropout layers.
• In dense layers: change the number of neurons in the layer.
• Change the number of dense layers.
• Change the hyperparameters.
2.a: Design an architecture that achieves a loss on the training data that is as far below 0.28 as
you can. Add the corresponding plots to the report, and describe the architecture, and the
reasoning behind your changes.
[8 marks]
2.b: Design an architecture (different from the one above) that achieves a loss on the validation
data that is as far below 0.27 as you can. Add the corresponding plots to the report, describe the
architecture, and the reasoning behind your changes.
[10 marks]
2.c: Use both architectures from the points above on the test data, and comment on which one
performs best. Hint: the results on the test set are currently printed in the terminal at the end of
training.
[6 marks]
2.d: Build the confusion matrix of your best architecture over the test set, and add it to the report.
Which class is the easiest and which one the most difficult to classify?
[6 marks]
软件开发、广告设计客服
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
软件定制开发网!