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