Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
git-svn-id: https://pmtk3.googlecode.com/svn/trunk@2730 b6abd7f4-f95b-11de-aa3c-59de0406b4f5
  • Loading branch information
murphyk2 committed Mar 14, 2011
1 parent e283942 commit 5eac881
Show file tree
Hide file tree
Showing 2 changed files with 134 additions and 136 deletions.
17 changes: 15 additions & 2 deletions projects/sceneContext/obsModelFit.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,20 @@
% There are several types of obs model.
% - 'gauss': we fit a model to the features
% p(Y(i,j,:)|X(i,j)=k) = gauss(mu(:,j,k), Sigma(:,:,j,k)
% - 'quantize': we discretize Y(i,j) and fit a model of the form
% p(Y(i,j)=b | X(i,j)=k) = T(j,k,b), sum_{b=1}^B = 1
% where B = num bins
% - 'localev': Y(i,j,k) = p(X(i,j)=k|evidence)
% If Y is just 2d, we assume Y(i,j) = p(X(i,j)=on|evidence) for binary X
%
% The purpose of the localev obstypes is if some external
% process has already transformed the features into probabilities.
% We still want to treat this data like any other feature,
% so we can potentially recalibrate it.

%
% The model created by this can be used in
% localEvToSoftEvBatch

% This file is from pmtk3.googlecode.com

[Ncases Nnodes Ndims] = size(Y); %#ok
Expand All @@ -23,8 +29,15 @@
model.Ndims = Ndims;
model.Nnodes = Nnodes;
switch obstype
case {'localev', 'localev1'}
case {'localev'}
% no-op
case 'quantize'
if Ndims > 1
error('we currently only quantize 1d features')
end
model.Nbins = 10;
model.CPT = zeros(Nnodes,
hist(scores(ndx,c))
case 'gauss'
[model.localCPDs, model.localCPDpointers, ...
model.localMu, model.localSigma] = ...
Expand Down
Loading

0 comments on commit 5eac881

Please sign in to comment.