what is the option to save the weights from plotsomplanes?
조회 수: 1 (최근 30일)
이전 댓글 표시
채택된 답변
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 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!