MATLAB Answers

How to transform fully connected layer into convolution layer?

7 views (last 30 days)
QU HAIFENG
QU HAIFENG on 11 Jun 2018
Answered: Shounak Mitra on 21 Jun 2018
I want to replace a fully connected layer with a convolution layer, but I don't know how to complete it. I reference help document, and find a function named "transposedConv2dLayer", but I don't believe "cropping" is helpful. So if somebody could give me any suggest, thanks a lot.

  0 Comments

Sign in to comment.

Answers (1)

Shounak Mitra
Shounak Mitra on 21 Jun 2018
Hello QU,
Can you please tell me if you're using a Series or DAG network? The steps to replace a layer is different for these 2 network types.
For a Series Network, follow steps here --> https://www.mathworks.com/help/nnet/examples/transfer-learning-using-alexnet.html#d119e3782
For DAG follow this --> https://www.mathworks.com/help/nnet/ref/nnet.cnn.layergraph.html?s_tid=doc_ta#d119e84822
Also, is the motivation behind replacing the FC layer with a conv2d is to make the network deeper?

  0 Comments

Sign in to comment.

Sign in to answer this question.