Reshape layer in deep learning

I want to try out a deep learning architecture which first does fully connected layers and then transitions into image convolutions. So after the fully connected layers I want to reshape the weights from a vector into a image like matrix. Is there a reshape layer within the Deep learning toolbox which does this?

1 comentario

SHAOJIN MA
SHAOJIN MA el 21 de Mayo de 2024
Hi KB,
Did you solve this problem? If yes, could you please show your code? I have encountered the same problem as you.

Iniciar sesión para comentar.

 Respuesta aceptada

Shivam Sardana
Shivam Sardana el 22 de Mayo de 2019

0 votos

There is no reshape layer in MATLAB which changes output from fully connected layer into image like matrix. You can create a custom deep learning layer to solve this problem. You can refer to this documentation link for more details on creating a custom layer: https://www.mathworks.com/help/deeplearning/ug/define-custom-deep-learning-layers.html
Hope this helps.

Más respuestas (1)

Tomaso Cetto
Tomaso Cetto el 31 de Mzo. de 2022

1 voto

Hi KB,
As of R2022a, the Deep Learning Toolbox has a new functionLayer - this layer enanbles you to apply a function to the activations of your network. Using this layer is the preferred way of performing the reshaping operation you're after. The link above has an example of how to do this, under the 'Reformat Data Using Function Layer' heading.
Hope this helps!

Categorías

Más información sobre Deep Learning Toolbox en Centro de ayuda y File Exchange.

Productos

Versión

R2019a

Preguntada:

KB
el 14 de Mayo de 2019

Comentada:

el 21 de Mayo de 2024

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by