Mercurial > hg > camir-ismir2012
annotate toolboxes/FullBNT-1.0.7/netlab3.3/gpunpak.m @ 0:cc4b1211e677 tip
initial commit to HG from
Changeset:
646 (e263d8a21543) added further path and more save "camirversion.m"
author | Daniel Wolff |
---|---|
date | Fri, 19 Aug 2016 13:07:06 +0200 |
parents | |
children |
rev | line source |
---|---|
Daniel@0 | 1 function net = gpunpak(net, hp) |
Daniel@0 | 2 %GPUNPAK Separates hyperparameter vector into components. |
Daniel@0 | 3 % |
Daniel@0 | 4 % Description |
Daniel@0 | 5 % NET = GPUNPAK(NET, HP) takes an Gaussian Process data structure NET |
Daniel@0 | 6 % and a hyperparameter vector HP, and returns a Gaussian Process data |
Daniel@0 | 7 % structure identical to the input model, except that the covariance |
Daniel@0 | 8 % bias BIAS, output noise NOISE, the input weight vector INWEIGHTS and |
Daniel@0 | 9 % the vector of covariance function specific parameters FPAR have all |
Daniel@0 | 10 % been set to the corresponding elements of HP. |
Daniel@0 | 11 % |
Daniel@0 | 12 % See also |
Daniel@0 | 13 % GP, GPPAK, GPFWD, GPERR, GPGRAD |
Daniel@0 | 14 % |
Daniel@0 | 15 |
Daniel@0 | 16 % Copyright (c) Ian T Nabney (1996-2001) |
Daniel@0 | 17 |
Daniel@0 | 18 % Check arguments for consistency |
Daniel@0 | 19 errstring = consist(net, 'gp'); |
Daniel@0 | 20 if ~isempty(errstring); |
Daniel@0 | 21 error(errstring); |
Daniel@0 | 22 end |
Daniel@0 | 23 if net.nwts ~= length(hp) |
Daniel@0 | 24 error('Invalid weight vector length'); |
Daniel@0 | 25 end |
Daniel@0 | 26 |
Daniel@0 | 27 net.bias = hp(1); |
Daniel@0 | 28 net.noise = hp(2); |
Daniel@0 | 29 |
Daniel@0 | 30 % Unpack input weights |
Daniel@0 | 31 mark1 = 2 + net.nin; |
Daniel@0 | 32 net.inweights = hp(3:mark1); |
Daniel@0 | 33 |
Daniel@0 | 34 % Unpack function specific parameters |
Daniel@0 | 35 net.fpar = hp(mark1 + 1:size(hp, 2)); |
Daniel@0 | 36 |