Skip to content

Commit

Permalink
* Disable hyperpriors default setting so that the estimated priors
Browse files Browse the repository at this point in the history
  on the means just use the maximum likelihood estimates.
* Added four more iterations on the Gauss-Siedel iterations of the
  template updates.
* Changed the tolerance for assessing convergence of the overall
  algorithm.
  • Loading branch information
JohnAshburner committed Sep 14, 2020
1 parent 216696f commit 6e44063
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion spm_mb_fit.m
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
end
fprintf('\n');

if it0==nit_max || (oE-E/nvox(dat) < sett.tol && it0>=nit_zm0)
if it0==nit_max || (oE-E/nvox(dat) < sett.tol*4 && it0>=nit_zm0)
break;
else
% Compute deformations from velocities (unless this is to be done
Expand Down
5 changes: 1 addition & 4 deletions spm_mb_shape.m
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,6 @@
% This could be made more efficient.

% Parse function settings
accel = sett.accel;
accel = 0.99;
B = sett.B;
d = sett.ms.d;
Expand Down Expand Up @@ -474,7 +473,7 @@
update_settings = [mu_settings(1:3) mu_settings(4:end)*(1-1/(K+1)) 2 2];
if accel>0, s = softmax(mu); end
dmu = zeros(size(mu),'like',mu);
for it=1:16
for it=1:20
for k=1:K

% Diagonal elements of Hessian
Expand Down Expand Up @@ -536,7 +535,6 @@
function dat = update_simple_affines(dat,mu,sett)

% Parse function settings
accel = sett.accel;
accel = 0.99;
B = sett.B;
if ~isempty(B)
Expand Down Expand Up @@ -634,7 +632,6 @@
function dat = update_velocities(dat,mu,sett)

% Parse function settings
accel = sett.accel;
accel = 0.99; % Speed up the registration
nw = get_num_workers(sett,4*sett.K+4*3);

Expand Down
3 changes: 2 additions & 1 deletion tbx_cfg_mb.m
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@
pr_upd.tag = 'hyperpriors';
pr_upd.name = 'Optimise';
pr_upd.labels = {'Yes','No'};
pr_upd.values = {{'b0_priors',{1000,10}}, []};
%pr_upd.values = {{'b0_priors',{1000,10}}, []};
pr_upd.values = {{}, []};
pr_upd.val = {pr_upd.values{1}};
pr_upd.help = {['Specify whether the Gaussian-Wishart priors be updated at each iteration. '...
'Enabling this can slow down convergence if there are small numbers of subjects. '...
Expand Down

0 comments on commit 6e44063

Please sign in to comment.