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