1 / 7
实验题目:固定增量法求分界面
实验目的:利用感知器训练算法中的固定增量法求分界面,将样本集分为两
类;使用 MATLAB 编程,学习并掌握该种模式识别的分类方法。
实验原理:对于两类问题,利用增广型模式向量和增广型加权限量以及判决
规则
�
0
0
�
�
xw
T
,则
�
�
�
�
i
j
w
w
x
。
实验步骤及相关代码:
一 、
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
2
0
,
1
1
,
0
1
1
X
的 增 广 型 模 式 向 量
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
1
2
0
,
1
1
1
,
1
0
1
'
1
X
;
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
3
1
,
2
2
,
1
2
2
X
的增广型模式向量
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
1
3
1
,
1
2
2
,
1
1
2
'
2
X
,令初始权向量为
�
�
�
�
�
�
�
�
�
�
�
1
1
1
w
,
固定增量 P=0.6。
*使用 matlab 编写后的结果
创建 m 文件如下:
function PR1()
disp('***** Well! This function is used to display the perception algorithm.
Enjoy the process of this show! *****');
A=input('please input the augmentation matrix totally');
[m,n]=size(A);
while m==0&&n==0
disp('Error! You know, the input must be the "true" matrix.');%错误检查
disp('So,input again!' );
A=input('please input the augmentation matrix totally');
[m,n]=size(A);
end
w=ones(1,m)';
count=0;p=0.7; %固定增量为0.7
while count~=n
count=0;
for i=1:n
g=w'*A(:,i);
评论0