本次加拿大代写是matlab卷积神经网络数字识别的一个project

## 1. Instructions

These instructions are also true to all the remaining projects unless indicated. Please read them

carefully.

1. Students are encouraged to discuss projects. However, each student needs to write

code and a report all by him/herself. Code should NOT be shared or copied. Do NOT

use external code unless permitted. Obviously, it is not OK to look at the code and just

reimplement with very similar coding structure.

2. Post questions to Canvas:Discussions so that everybody can share, unless the

questions are private. Please look at Canvas:Discussions first if similar questions have

been posted. For private questions, please use Canvas:Inbox.

3. Two files need to be uploaded. First, your write-up (the main document) must be named

as {Your-SFUID}.pdf and uploaded to Canvas. Second, a zip package must be uploaded

to also Canvas with the following directory structure (they will be different for the other

projects but will be similar):

○ {SFUID}/

■ ec

● ec.m

■ matlab/

● col2im_conv.m

● col2im_conv_matlab.m

● conv_layer_backward.m

● conv_layer_forward.m

● conv_net.m

● convnet_forward.m

● get_lenet.m

● get_lr.m

● im2col_conv.m

● im2col_conv_matlab.m

● init_convnet.m

● inner_product_backward.m

● inner_product_forward.m

● load_mnist.m

● mlrloss.m

● pooling_layer_backward.m

● pooling_layer_forward.m

● relu_forward.m

● relu_backward.m

● sgd_momentum.m

● test_components.m

● test_network.m

● train_lenet.m

● vis_data.m

● lenet_pretrained.mat

● mnist all.mat

○ Project 1 has 13 pts.

4. File paths: Make sure that any file paths that you use are relative and not absolute so

that we can easily run code on our end. For instance, you cannot write

“imread(‘/some/absolute/path/data/abc.jpg’)”. Write “imread(‘../data/abc.jpg’)” instead.

## 2. Overview

In this assignment you will implement a convolutional neural network (CNN). You will be

building a numeric character recognition system trained on the MNIST dataset.

We begin with a brief description of the architecture and the functions. For more details,

you can refer to online resources such as http://cs231n.stanford.edu. Note that the

amount of coding in this assignment is a lot less than the other assignments. We will not provide

detailed instructions, and one is expected to search online and/or reverse-engineer template

code.

A typical convolutional neural network has four different types of layers.

**Fully Connected Layer / Inner Product Layer (IP)**

The fully connected or the inner product layer is the simplest layer which makes up

neural networks. Each neuron of the layer is connected to all the neurons of the

previous layer (See Fig 1). Mathematically it is modelled by a matrix multiplication and

the addition of a bias term. For a given input x the output of the fully connected layer is

given by the following equation,

f (x) = W x + b

W, b are the weights and biases of the layer. W is a two dimensional matrix of m × n

size where n is the dimensionality of the previous layer and m is the number of neurons

in this layer. b is a vector with size m × 1.