How to get the weight after training a SeriesNetwork?

10 views (last 30 days)
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!

Accepted Answer

Mukul Rao
Mukul Rao on 5 Dec 2017
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

More Answers (0)

Community Treasure Hunt

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

Start Hunting!