How can we convert SeriesNetwork to Network?
조회 수: 2 (최근 30일)
이전 댓글 표시
Dear Guys,
I already have done some customized feedfarword networks which work on sound/speech processing with 'Network' type (processed by 'train' function). Then, I have tried to use an 'trainNetwork' function to train DNN (by ignoring lstmlayer) as well as LSTM. However, I do not have any idea how to utlize this object; like how to implement as Network object on my old project.
Is there anyway to convert SeriesNetwork to Network?
Thank you in advance,
Qilonz
댓글 수: 0
답변 (1개)
Akshat
2025년 1월 29일
As far as I know, there is no way to convert a "SeriesNetwork" to "Network" via inbuilt methods.
As a workaround, you can try extracting the weights and biases of the "SeriesNetwork" and make a custom "Network" using a script like the following:
% Assume 'trainedNet' is your SeriesNetwork object
layers = trainedNet.Layers;
% Create a new Network object
net = network;
numLayers = numel(layers);
net.numLayers = numLayers;
for i = 1:numLayers
layer = layers(i);
% Example for a fully connected layer
if isa(layer, 'nnet.cnn.layer.FullyConnectedLayer')
% Set the layer size
net.layers{i}.size = layer.OutputSize;
% Set weights and biases
net.IW{i,1} = layer.Weights;
net.b{i} = layer.Bias;
end
% Add similar logic for other layer types
end
% Configure input and output settings
net.inputs{1}.size = size(layers(1).InputSize, 1);
net.outputs{numLayers}.size = layers(end).OutputSize;
% You will need to set up connections and transfer functions manually
Hope this helps your use case.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!