wolffd@0: function net = gpunpak(net, hp) wolffd@0: %GPUNPAK Separates hyperparameter vector into components. wolffd@0: % wolffd@0: % Description wolffd@0: % NET = GPUNPAK(NET, HP) takes an Gaussian Process data structure NET wolffd@0: % and a hyperparameter vector HP, and returns a Gaussian Process data wolffd@0: % structure identical to the input model, except that the covariance wolffd@0: % bias BIAS, output noise NOISE, the input weight vector INWEIGHTS and wolffd@0: % the vector of covariance function specific parameters FPAR have all wolffd@0: % been set to the corresponding elements of HP. wolffd@0: % wolffd@0: % See also wolffd@0: % GP, GPPAK, GPFWD, GPERR, GPGRAD wolffd@0: % wolffd@0: wolffd@0: % Copyright (c) Ian T Nabney (1996-2001) wolffd@0: wolffd@0: % Check arguments for consistency wolffd@0: errstring = consist(net, 'gp'); wolffd@0: if ~isempty(errstring); wolffd@0: error(errstring); wolffd@0: end wolffd@0: if net.nwts ~= length(hp) wolffd@0: error('Invalid weight vector length'); wolffd@0: end wolffd@0: wolffd@0: net.bias = hp(1); wolffd@0: net.noise = hp(2); wolffd@0: wolffd@0: % Unpack input weights wolffd@0: mark1 = 2 + net.nin; wolffd@0: net.inweights = hp(3:mark1); wolffd@0: wolffd@0: % Unpack function specific parameters wolffd@0: net.fpar = hp(mark1 + 1:size(hp, 2)); wolffd@0: