How to get the weight after training a SeriesNetwork?

6 次查看(过去 30 天)
Hello,
I tried to get the weight of my network after training it. So I called getwb(net), but I just got the following error: No appropriate method, property, or field 'numLayers' for class 'SeriesNetwork'. With layers(2).Weights I just got the Weights I started with. Has anybody an idea what I did wrong or what I can do to get the trained weights?
Thanks a lot!

采纳的回答

Mukul Rao
Mukul Rao 2017-12-5
Hello, I work for the MathWorks technical support team. The "getwb" function is only supported by legacy neural network objects. The "SeriesNetwork" object, which is relatively new does not have a documented method for obtaining weights and biases. There is an existing enhancement request in place.
It is possible however, to print the weights and biases associated for each layer.
For example,
net = alexnet
net.Layers(2).Weights %Weights of Convolution layer
net.Layers(2).Bias %Biases of Convolution layer

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Data Workflows 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by