what is the option to save the weights from plotsomplanes?
4 views (last 30 days)
Show older comments
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
0 Comments
Accepted Answer
Gourab
on 14 Jun 2023
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.
More Answers (0)
See Also
Categories
Find more on Deep Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!