annotate toolboxes/RBM/discrete2softmax.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 S = discrete2softmax( D,Vals )
wolffd@0 2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wolffd@0 3 % convert a col-array of discrete value to softmax %
wolffd@0 4 % D: col-array %
wolffd@0 5 % Vals: list of possible values %
wolffd@0 6 % sontran2012 %
wolffd@0 7 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
wolffd@0 8 S = zeros(size(D,1),size(Vals,2));
wolffd@0 9 for i=1:size(D,1)
wolffd@0 10 S(i,find(Vals==D(i))) = 1;
wolffd@0 11 end
wolffd@0 12
wolffd@0 13 end
wolffd@0 14