Mercurial > hg > mauch-mirex-2010
annotate _FullBNT/BNT/CPDs/@softmax_CPD/private/extract_params.m @ 9:4ea6619cb3f5 tip
removed log files
author | matthiasm |
---|---|
date | Fri, 11 Apr 2014 15:55:11 +0100 |
parents | b5b38998ef3b |
children |
rev | line source |
---|---|
matthiasm@8 | 1 function [W, b] = extract_params(CPD) |
matthiasm@8 | 2 |
matthiasm@8 | 3 % W(X,Y,Q), b(Y,Q) where Y = ns(self), X = ns(cps), Q = prod(ns(dps)) |
matthiasm@8 | 4 |
matthiasm@8 | 5 glimsz = prod(CPD.sizes(CPD.dpndx)); |
matthiasm@8 | 6 ss = CPD.sizes(end); |
matthiasm@8 | 7 cpsz = sum(CPD.sizes(CPD.cpndx)); |
matthiasm@8 | 8 dp_as_cpsz = sum(CPD.sizes(CPD.dps_as_cps.ndx)); |
matthiasm@8 | 9 W = zeros(dp_as_cpsz + cpsz, ss, glimsz); |
matthiasm@8 | 10 b = zeros(ss, glimsz); |
matthiasm@8 | 11 |
matthiasm@8 | 12 for i=1:glimsz |
matthiasm@8 | 13 W(:,:,i) = CPD.glim{i}.w1; |
matthiasm@8 | 14 b(:,i) = CPD.glim{i}.b1(:); |
matthiasm@8 | 15 end |
matthiasm@8 | 16 |
matthiasm@8 | 17 W = myreshape(W, [dp_as_cpsz + cpsz ss CPD.sizes(CPD.dpndx)]); |
matthiasm@8 | 18 b = myreshape(b, [ss CPD.sizes(CPD.dpndx)]); |