change outputlayer in layergraph object
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Rubén
el 18 de Mayo de 2023
Comentada: Rubén
el 24 de Mayo de 2023
Hello,
I have a layerGraph object and I need to remove the output layer because it is not relevant and it is not supported by Deep Learning HDL Toolbox.
I removed another layer and then make the corresponding connection but the output layer is different because I need to change the 'OutputNames' or set the out output layer in other way. However, 'OutputNames' property is read only.
I also tried to replace the last layer by the previous one and remove the previous layer but I get the same result
find in the following link the layerGraph object layers.mat
Is there any way to change the output layer in a layerGraph object?
Thank you in advance.
0 comentarios
Respuesta aceptada
Matt J
el 18 de Mayo de 2023
For example,
lgraph=layerGraph(regressionLayer)
layers=lgraph.Layers;
layers(end).Name='newName';
lgraph=layerGraph(layers)
8 comentarios
Matt J
el 21 de Mayo de 2023
Editada: Matt J
el 21 de Mayo de 2023
It will definitely given an error because it has no input and output layers, but that is not the point. Your original question was how to change the output name property of an output layer within an existing layerGraph and my original answer demonstrated how to do that.
If the question is about making predictions in a network without using an output layer, you can do it by using dlnetwork instead of assembleNetwork.
cl=convolution2dLayer([3,3],1 ,'Padding','same','Weights',rand(3),'Bias',0);
net=dlnetwork(cl,networkDataLayout([8,8,1],'SSC'));
net.predict(dlarray(rand(8),'SSC'))
Más respuestas (0)
Ver también
Categorías
Más información sobre Build Deep Neural Networks en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!