Stopping Iterative Algorithms
Iterative algorithms allow for different stopping criteria such as:
TimeStoppingCriterion: Define a maximum time in secondsImprovementStoppingCriterion: Stop after improvement between two iterations is below a certain thresholdIterationStoppingCriterion: Stop aftermaxIternumber of iterations
Multiple criteria can be added as follows:
PARAFAC alg = new PARAFAC();
alg.addStoppingCriterion(CriterionUtils.iterations(1000)); // Stop after 1000 iterations
alg.addStoppingCriterion(CriterionUtils.time(100)); // Stop after 100 seconds
alg.addStoppingCriterion(CriterionUtils.improvement(10E-10)); // Stop if relative improvement is less than 10E-10
Note
- Algorithm stops if one of the criteria matches
- Adding a certain criterion multiple times will result in overwriting.