如何在Matlab中使用训练好的神经网络进行实际系统的分类(How to use trained Neural Network in Matlab for classification in a re

编程入门 行业动态 更新时间:2024-10-11 23:24:45
如何在Matlab中使用训练好的神经网络进行实际系统的分类(How to use trained Neural Network in Matlab for classification in a real system)

我在包含语音特征和加速度计测量的数据集上使用Matlab神经网络工具箱训练了前馈神经网络。 Targetset包含两个数据集目标类:0和1.培训,验证和性能都很好,我已经为这个网络生成了代码。

现在我需要实时使用这个神经网络来识别出现时的模式,并在我针对之前训练过的NN测试新数据集时生成0或1。 但是当我发出命令时:

c = sim(net, j)

其中“j”是新数据集[24x11]; 相反0或1我得到这个作为输出(我假设我得到正确分类的百分比,但没有分类结果本身):

c = Columns 1 through 9 0.6274 0.6248 0.9993 0.9991 0.9994 0.9999 0.9998 0.9934 0.9996 Columns 10 through 11 0.9966 0.9963

那么有什么命令或方法可以实际看到分类结果吗? 任何帮助高度赞赏! 谢谢

I have trained Feed Forward NN using Matlab Neural Network Toolbox on a dataset containing speech features and accelerometer measurements. Targetset contains two target classes for dataset: 0 and 1. The training, validation and performance are all fine and I have generated code for this network.

Now I need to use this neural network in real-time to recognize pattern when occur and generate 0 or 1 when I test a new dataset against previously trained NN. But when I issue a command:

c = sim(net, j)

Where "j" is a new dataset[24x11]; instead 0 or 1 i get this as an output (I assume I get percent of correct classification but there is no classification result itself):

c = Columns 1 through 9 0.6274 0.6248 0.9993 0.9991 0.9994 0.9999 0.9998 0.9934 0.9996 Columns 10 through 11 0.9966 0.9963

So is there any command or a way that I can actually see classification results? Any help highly appreciated! Thanks

最满意答案

我不是matlab用户,但从逻辑的角度来看,你错过了一个重要的观点:

神经网络的输入是单个向量,您传递矩阵。 因此,matlab认为你想要对一堆向量进行分类(在你的情况下为11)。 因此,您获得的向量是这11个向量中的每一个的输出激活。

输出激活是介于0和1之间的值(我猜你使用的是sigmoid),所以这是完全正常的。 您的工作是获得最适合您数据的阈值。 您可以通过对训练/测试数据进行交叉验证来获得此阈值,或者只选择一个(0.5?)并查看结果是否“良好”并根据需要进行修改。

I'm no matlab user, but from a logical point of view, you are missing an important point:

The input to a Neural Network is a single vector, you are passing a matrix. Thus matlab thinks that you want to classify a bunch of vectors (11 in your case). So the vector that you get is the output activation for every of these 11 vectors.

The output activation is a value between 0 and 1 (I guess you are using the sigmoid), so this is perfectly normal. Your job is to get a threshold that fits your data best. You can get this threshold with cross validation on your training/test data or by just choosing one (0.5?) and see if the results are "good" and modify if needed.

更多推荐

本文发布于:2023-08-06 09:07:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1447610.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:神经网络   如何在   系统   Matlab   trained

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!