⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hopfnet1.m

📁 Matlab写得神经网络的训练实例
💻 M
字号:
function HOPFnet1()
nntwarn off
T=[1 -1;-1 1];
[w,b]=solvehop(T)
y=simuhop(T,w,b)

a=rands(2,1);
y=simuhop(a,w,b,20);
plot(T(1,:),T(2,:),'r*');axis([-1.1 1.1 -1.1 1.1]);
xlabel('T(1),a(1)');ylabel('T(2),a(2)');
record=[cell2mat({a}) cell2mat({y})]; %组合一个细胞组矩阵到一个矩阵中
start=cell2mat({a});
hold on;plot(start(1,1),start(2,1),'bx',record(1,:),record(2,:));
%使用10个随机点,对网络进行仿真20步,测试输出结果,并绘制达到稳定点的轨迹
figure;color='rgbmy';
plot(T(1,:),T(2,:),'r*');axis([-1.1 1.1 -1.1 1.1]);
xlabel('T(1),a(1)');ylabel('T(2),a(2)');hold on;
for i=1:10
    a=rands(2,1);
    [y yy]=simuhop(a,w,b,20);
    plot(yy(1,1),yy(2,1),'kx',yy(1,:),yy(2,:),color(rem(i,5)+1));
    drawnow
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -