MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   单层神经网络中的matlab语法错误 (https://www.labfans.com/bbs/showthread.php?t=23770)

poster 2019-12-10 20:48

单层神经网络中的matlab语法错误
 
我必须实现一个单层神经网络或感知器,为此,我有2个文件数据集,一个用于输入,一个用于输出,我必须在matlab中执行此操作而不使用神经工具箱.2个文件的格式是如下。

In: 0.832 64.643 0.818 78.843 1.776 45.049 0.597 88.302 1.412 63.458 Out: 0 0 1 0 0 1 0 1 0 0 0 1 0 0 1 目标输出对于相应输入所属的特定类别为“ 1”,对于其余2个输出为“ 0”。

我试图这样做,但是它对我不起作用。

load in.data load out.data x = in(:1); y = in(:2); learning rate = 0.2; max_iteration = 50; function result = calculateOutput(weights,x, y) s = x*(weights(1) +weight(2) +weight(3)); if s>=0 result = 1 else: result = -1 end end Count = length(x); weights[0] = rand(); weights[1] = rand(); weights[2] = rand(); iter = 0; do { iter++; globalerror = 0; for(p=0; p


所有时间均为北京时间。现在的时间是 00:58

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.