Skip to content

Commit

Permalink
Angular sampling updates for gradient optimization, when allow_coarse…
Browse files Browse the repository at this point in the history
…r_samplings is true.
  • Loading branch information
dkimanius committed Oct 27, 2020
1 parent 3bf913b commit 89480b1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/ml_optimiser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2947,7 +2947,8 @@ void MlOptimiser::expectation()

// C. Calculate expected minimum angular errors (only for 3D refinements)
// And possibly update orientational sampling automatically
if (!((iter==1 && do_firstiter_cc) || do_always_cc) && !(do_skip_align || do_only_sample_tilt) && !do_grad)
if (!((iter==1 && do_firstiter_cc) || do_always_cc) && !(do_skip_align || do_only_sample_tilt) &&
(!do_grad || (iter % 10 == 0 && mymodel.nr_classes > 1 && allow_coarser_samplings)))
{
// Set the exp_metadata (but not the exp_imagedata which is not needed for calculateExpectedAngularErrors)
int n_trials_acc = (mymodel.ref_dim==3 && mymodel.data_dim != 3) ? 100 : 10;
Expand Down Expand Up @@ -4357,6 +4358,8 @@ void MlOptimiser::maximization()
if (verb > 0)
progress_bar(mymodel.nr_classes);

if (skip_class >= 0)
std::cerr << " Class " << skip_class << " replaced due to inactivity." << std::endl;
}

void MlOptimiser::centerClasses()
Expand Down Expand Up @@ -4689,7 +4692,6 @@ int MlOptimiser::maximizationGradientParameters() {
}
mymodel.class_age[drop_class_idx] = mymodel.class_age[expand_class_idx] * 0.9;
skip_class = drop_class_idx;
std::cerr << "Dropping class " << drop_class_idx << " replacing with " << expand_class_idx << std::endl;
}

// If SOM, sometimes expand without a drop
Expand Down Expand Up @@ -9148,6 +9150,7 @@ void MlOptimiser::updateAngularSampling(bool myverb)
}

}

void MlOptimiser::updateSubsetSize(bool myverb)
{
// If we're doing cisTEM-like acceleration of refinement through subsets: set the subset size here
Expand Down

0 comments on commit 89480b1

Please sign in to comment.