comparison toolboxes/FullBNT-1.0.7/netlab3.3/gpunpak.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 function net = gpunpak(net, hp)
2 %GPUNPAK Separates hyperparameter vector into components.
3 %
4 % Description
5 % NET = GPUNPAK(NET, HP) takes an Gaussian Process data structure NET
6 % and a hyperparameter vector HP, and returns a Gaussian Process data
7 % structure identical to the input model, except that the covariance
8 % bias BIAS, output noise NOISE, the input weight vector INWEIGHTS and
9 % the vector of covariance function specific parameters FPAR have all
10 % been set to the corresponding elements of HP.
11 %
12 % See also
13 % GP, GPPAK, GPFWD, GPERR, GPGRAD
14 %
15
16 % Copyright (c) Ian T Nabney (1996-2001)
17
18 % Check arguments for consistency
19 errstring = consist(net, 'gp');
20 if ~isempty(errstring);
21 error(errstring);
22 end
23 if net.nwts ~= length(hp)
24 error('Invalid weight vector length');
25 end
26
27 net.bias = hp(1);
28 net.noise = hp(2);
29
30 % Unpack input weights
31 mark1 = 2 + net.nin;
32 net.inweights = hp(3:mark1);
33
34 % Unpack function specific parameters
35 net.fpar = hp(mark1 + 1:size(hp, 2));
36