📄 naturalg.m
字号:
function [y,e]=naturalg(N)
%
%
load Speech4;
s1=Speech4(1,:);
s2=Speech4(3,:);
s3=Speech4(4,:);
s=[s1;s2;s3];
A=unifrnd(0,1,3,3);
u=0.0005;
W=eye(3);
X=A*s;
Y=W*X;
e=zeros(1,length(X*N));
for k=1:N
for i=1:length(X)-1
fy(:,i)=-2*tanh(Y(:,i));
W=W+u*(inv(W')+fy(:,i)*X(:,i)');
Y(:,i+1)=W*X(:,i+1);
p=W*A;
a=0;
b=0;
for j=1:length(A)
a=a+sum(abs(p(j,:)))/max(abs(p(j,:)))-1;
b=b+sum(abs(p(:,j)))/max(abs(p(:,j)))-1;
end
e(i+(k-1)*length(X))=a+b;
end
end
y=Y;
subplot(331);
plot(s1);
subplot(332);
plot(s2);
subplot(333);
plot(s3);
subplot(334);
plot(X(1,:));
subplot(335);
plot(X(2,:));
subplot(336);
plot(X(3,:));
subplot(337);
plot(y(1,:));
subplot(338);
plot(y(2,:));
subplot(339);
plot(y(3,:));
figure(2);
plot(e);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -