comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 function S = discrete2softmax( D,Vals )
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 % convert a col-array of discrete value to softmax %
4 % D: col-array %
5 % Vals: list of possible values %
6 % sontran2012 %
7 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8 S = zeros(size(D,1),size(Vals,2));
9 for i=1:size(D,1)
10 S(i,find(Vals==D(i))) = 1;
11 end
12
13 end
14