简体   繁体   English

使用 GPML (Matlab) 的高斯过程的第一个非演示示例?

[英]First non demo example for Gaussian process using GPML (Matlab)?

After having some basics understanding of GPML toolbox , I written my first code using these tools.在对GPML 工具箱有了一些基本的了解之后,我使用这些工具编写了我的第一个代码。 I have a data matrix namely data consist of two array values of total size 1000. I want to use this matrix to estimate the GP value using GPML toolbox.我有一个数据矩阵,即data由两个总大小为 1000 的数组值组成。我想使用这个矩阵来估计使用 GPML 工具箱的 GP 值。 I have written my code as follows :我写了我的代码如下:

x = data(1:200,1);    %training inputs
Y = data(1:201,2);  %, training targets 

Ys = data(201:400,2);   
Xs = data(201:400,1);    %possibly test cases


covfunc = {@covSE, 3}; 
ell = 1/4; sf = 1; 
hyp.cov = log([ell; sf]);
likfunc = @likGauss; 
sn = 0.1;
hyp.lik = log(sn);
[ymu ys2 fmu fs2] = gp(hyp, @infExact, [], covfunc, likfunc,X,Y,Xs,Ys);

plot(Xs, fmu);

But when I am running this code getting error 'After having some basics understanding of GPML toolbox , I written my first code using these tools.但是,当我运行此代码时出现错误“在对GPML 工具箱有了一些基本了解之后,我使用这些工具编写了我的第一个代码。 I have a data matrix namely data consist of two array values of total size 1000. I want to use this matrix to estimate the GP value using GPML toolbox.我有一个数据矩阵,即data由两个总大小为 1000 的数组值组成。我想使用这个矩阵来估计使用 GPML 工具箱的 GP 值。 I have written my code as follows :我写了我的代码如下:

x = data(1:200,1);    %training inputs
Y = data(1:201,2);  %, training targets 

Ys = data(201:400,2);   
Xs = data(201:400,1);    %possibly test cases


covfunc = {@covSE, 3}; 
ell = 1/4; sf = 1; 
hyp.cov = log([ell; sf]);
likfunc = @likGauss; 
sn = 0.1;
hyp.lik = log(sn);
[ymu ys2 fmu fs2] = gp(hyp, @infExact, [], covfunc, likfunc,X,Y,Xs,Ys);

plot(Xs, fmu);

But when I am running this code getting:但是当我运行这段代码时:

Error using covMaha (line 58) Parameter mode is either 'eye', 'iso', 'ard', 'proj', 'fact', or 'vlen'使用 covMaha 时出错(第 58 行)参数模式为“eye”、“iso”、“ard”、“proj”、“fact”或“vlen”

Please if possible help me to figure out where I am making mistake ?如果可能,请帮助我找出我犯错的地方?

I know this is way late, but I just ran into this myself.我知道这已经很晚了,但我自己也遇到了这个问题。 The way to fix it is to change修复它的方法是改变

covfunc = {@covSE, 3};

to something like

covfunc = {@covSE, 'iso'};

It doesn't have to be 'iso' , it can be any of the options listed in the error message.它不必是'iso' ,它可以是错误消息中列出的任何选项。 Just make sure your hyperparameters are set correctly for the specific mode you choose.只需确保为您选择的特定模式正确设置了超参数。 This is detailed more in the covMaha.m file in GPML.这在 GPML 中的covMaha.m文件中有更详细的说明。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM