In the deep learning toolbox, I cannot easily manipulate a specific layer. For example, I know the name of a layer. How can I quickly find it in the layer array?
layers = [convolution2dLayer(3,3,'name','aa'); reluLayer('name','bb'); convolution2dLayer(3,3,'name','cc')]
for i = 1:length(layers) if strcmp(layers(i).Name,'cc') myfindLayer = layers(i); break; end end
If only
myfindLayer = layers ('cc')
can be operated like this! I hope the official will consider such a method, easy to operate!
ANSWER
Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.
I understand that you wish to search a layer based upon its name and not using its index. You can make use of the ‘Name’ property of a layer. Let’s consider the layer array you mentioned in the question and you want to find the layer with name ‘cc’. You can use – layers({layers.Name} == "cc")
or
layers(strcmp({layers.Name}, 'cc'))
Don’t forget to put double-quotes (“ “) in case you are comparing using ‘==’ operator or else use string(‘cc’).
SEE COMPLETE ANSWER CLICK THE LINK
Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.
layers({layers.Name} == "cc")
or
layers(strcmp({layers.Name}, 'cc'))
Don’t forget to put double-quotes (“ “) in case you are comparing using ‘==’ operator or else use string(‘cc’).
SEE COMPLETE ANSWER CLICK THE LINK
Comments
Post a Comment