nnplsprd.m

来自「偏最小二乘算法在MATLAB中的实现」· M 代码 · 共 20 行

M
20
字号
function ynpred=nnplsprd(W12,W23,B2,B3,x)
%NNPLSPRD Predictions using collapsed NNPLS model
% This program uses the collapsed NNPLS model to predict the responses
% of a new x block. The inputs are the the input to hidden layer weights 
% (W12), hidden layer to output weigts (W23), hidden layer biases (B2), 
% output bias (B3) and new x-block (x). The output is the new y-block
% predictions (ynpred). The I/O syntax is:
% ynpred=nnplspred(W12,W23,B2,B3,x)
[nx,mx]=size(x);
for i=1:nx
	yt(i,:)=(x(i,:)*W12'+B2);
end;
yt=[(1-exp(-yt))./(1+exp(-yt))];
for i=1:nx
	ynpred(i,:)=(yt(i,:)*W23+B3);
end;



⌨️ 快捷键说明

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