what is the option to save the weights from plotsomplanes?

1 次查看(过去 30 天)
i want to save the weights from plotsomPlanes so that i could use these waiegts as input for another network like ANFIS to improve the results is it possible? please guide
thank you

采纳的回答

Gourab
Gourab 2023-6-14
Hi Shazia,
I understand that you want to save the weights from the plotsomPlanes function to use in some other network like ANFIS.
It's possible to use the weights obtained from the ‘plotsomPlanes’ function in the SOM network as inputs to other machine learning algorithms like ANFIS to improve their results.
We can extract the weights of the SOM neurons by accessing the children property of the plot object.
Please refer to the below code snippet
data = load('sample_data.mat');
net = selforgmap([10 10]);
net = train(net, data.inputs');
plotsomPlanes(net);
% Extract SOM weights
plot_obj = gcf; % Get handle of the SOM plots
weights = [];
for i = 1:length(plot_obj.Children)
if isa(plot_obj.Children(i), 'matlab.graphics.primitive.Image')
weights = [weights; plot_obj.Children(i).CData(:)'];
end
end
% Use SOM weights as input to ANFIS
anfis_in = [data.inputs', weights];
anfis_out = data.targets';
anfis_model = anfis(anfis_in, anfis_out);
I hope this helps you to resolve the query.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Deep Learning Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by