MATLAB Answers


How to define a custom layer in deep learning toolbox which makes multiple copies of a matrix ?

Asked by Shraddha Jain on 18 Aug 2019 at 10:07
Latest activity Edited by Jyotsna Talluri on 22 Aug 2019 at 8:35
I have to design a deep fully connected neural network for regression task. I am using examples from the deep learning toolbox for images. My input matrix size and precticted matrix Y has the same size of [1 1 32]. But my target matrix T has size [168 1 32]. Since the regressionLayer requires the predicted Y and target T matrices to be of same size, for the purpose of my loss function I need to replicate the predicted matrix Y 168 times.
So, I want to know how to add a Layer while designing neural network which just does repmat() before I pass it to the last regressionLayer.
Thank you.

  1 Comment

Sign in to comment.

0 Answers