Skip to content

Commit

Permalink
Tighten MoDT.optimizeC() condition number check
Browse files Browse the repository at this point in the history
MoDT.optimizeC() is responsible for making sure that the fitted C matrix
satisfies the max_cond condition number threshold. However, due to numerical
innacuracies (and/or the difference between 1- and 2-norm condition
numbers), this was able to produce C matrices that didn't satisfy the
setParams() condition number check. This could lead to a situation where we
fit a MoDT model without problems but are unable to copy these values into a
new model using setParams().

To mitigate this problem, we tighten the condition number check inside
optimizeC (by 5%) in order to compensate for the potential difference.
  • Loading branch information
kqshan committed Apr 24, 2017
1 parent 7784a5c commit 3cfba95
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion @MoDT/optimizeC.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
% sum_wz [K x 1] sum of w(n,k)*Z(n,k) over all spikes for each component

[N,K] = size(wzu); D = size(mu,1);
min_rcond = 1/self.max_cond;
% To make sure that the output of optimizeC() will be accepted by setParams()
% (which checks the condition number of the C matrix it's given), we are going
% to use a slightly more conservative condition number (by 5%) here.
min_rcond = 1.05/self.max_cond;

% Allocate memory
C = zeros(D,D,K);
Expand Down

0 comments on commit 3cfba95

Please sign in to comment.