如何通过SOM从受过训练的数据中绘制U矩阵,命中样本和输入平面 [英] How plot U-Matrix, Sample Hit and Input Planes from a trained data by SOM

查看:240
本文介绍了如何通过SOM从受过训练的数据中绘制U矩阵,命中样本和输入平面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在MATLAB中编写了一个简单的SOM算法.我的最大挑战是,如何以U矩阵,样本匹配和组件/输入平面的格式可视化/绘制数据?这三个图存在于MATLAB的SOM工具箱中.但是问题是我无法调用它们来通过我的书面代码可视化我的数据.因为他们需要一个"net"作为输入,而我的代码中却没有任何"net".

有什么指导吗?

解决方案

您可以创建自己的函数,因为它们不太复杂.我将假设SOM为20x20x10(400个节点,4个功能)进行解释.

Hit-Map仅仅是将每个样本提供给已学习的SOM,并将+1递增给被选为最佳匹配单位(BMU)的节点.然后绘制此地图.因此,如果node(1,1)发射10次,而node(1,2)发射100次,那么您将得到一个图像,其中node(1,2)的强度高于node(1,1).

U矩阵是一张地图,表示节点的权重向量与其最接近的邻居之间的平均距离.因此,您可以在此处计算节点X的特征向量到每个邻居之间的欧几里得距离.因此,如果您有一个用于node(1,1,:)= [1,1,2,3]的特征向量,则node(1,2,:)= [2,2,1,1]和node(2 ,1,:)= [1,1,1,1],则节点(1,1)的U矩阵值可以为U(1,1)= norm(squeeze(node(1,1, :)-node(1,2,:)))+ norm(squeeze(node(1,1,:)-node(2,1,:)))= 4.8818

组件/输入平面是最简单的一个,不需要任何处理.您只需基本上选择SOM映射和图的每个要素.因此,在我们20x20x4 SOM的示例中,您将具有4个要素,因此有4个组件,可以通过特征1的图像c(node(:,:,1))进行绘制

I have written a simple SOM algorithm in MATLAB. My big challenge is that, how can I visualize/plot data in the format of U-Matrix, Sample Hits and Component/Input Planes? These three plots exists in the SOM toolbox in MATLAB. But the problem is that I cannot call them to visualize my data over my written code. Because they need a 'net' as input in which my code does not make any 'net'.

Is there any guidance?

解决方案

You can create your own functions as they are not too complicated. I will assume a SOM of 20x20x10 (400 nodes, 4 features) for explanation.

The Hit-Map is no more than giving each sample to the already learned SOM and incrementing +1 to the node that was chosen as the Best Matching Unit (BMU). Then you plot this map. So if node(1,1) fires 10 times, and node(1,2) fires 100 times, then you will have an image where node(1,2) has a higher intensity than node(1,1).

The U-Matrix is a map representing the average distance between the node's weight vector and its closest neighbours. So here you can calculate the Euclidean distance between the feature vector of node X to every neighbour. So if you had a feature vector for node(1,1,:)=[1,1,2,3], node(1,2,:)=[2,2,1,1], and node(2,1,:)=[1,1,1,1], then the value of the U-matrix for node(1,1) could be U(1,1)=norm(squeeze(node(1,1,:)-node(1,2,:)))+norm(squeeze(node(1,1,:)-node(2,1,:)))=4.8818

The Component/Input Planes is the simplest one and does not require any processing. You just basically pick each feature of the SOM map and plot. So in our example of a 20x20x4 SOM, you would have 4 features and therefore 4 components, which you can plot through imagesc(node(:,:,1)) for feature 1

这篇关于如何通过SOM从受过训练的数据中绘制U矩阵,命中样本和输入平面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆