Changeset 5d18f3


Ignore:
Timestamp:
Sep 13, 2025, 2:44:01 PM (6 weeks ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Candidate_v1.7.0, stable
Children:
9f1c84
Parents:
5b8c49
git-author:
Frederik Heber <frederik.heber@…> (08/30/25 15:56:12)
git-committer:
Frederik Heber <frederik.heber@…> (09/13/25 14:44:01)
Message:

FIX: PotentialTrainer did not heed take-best correctly.

  • we used the unset threshold for comparison instead of the passed _threshold parameter.
  • threshold needs to 0. when only best of how many/take best should be heeded.
  • TEST: This fixes failing test case for fit compound potential.
Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/PotentialAction/FitCompoundPotentialAction.def

    r5b8c49 r5d18f3  
    3333(STLVectorValidator< std::vector<const element *> >(1,99, ElementValidator())) \
    3434(PositiveValidator<unsigned int>()) \
    35 (PositiveValidator<double>()) \
     35(PositiveValidator<double>() && RangeValidator<double>(0.,1.)) \
    3636(PositiveValidator<unsigned int>())
    3737
  • src/Potentials/PotentialTrainer.cpp

    r5b8c49 r5d18f3  
    149149      unsigned int runs=0;
    150150      // threshold overrules max_runs
    151       const double threshold = _threshold;
    152       const unsigned int max_runs = (threshold >= 1.) ? _best_of_howmany : std::numeric_limits<unsigned int>::max();
     151      const double threshold = (_threshold >= 1.) ? 0. : _threshold;
     152      const unsigned int max_runs = (_threshold >= 1.) ? _best_of_howmany : std::numeric_limits<unsigned int>::max();
    153153      LOG(1, "INFO: Maximum runs is " << max_runs << " and threshold set to " << threshold << ".");
    154154      do {
Note: See TracChangeset for help on using the changeset viewer.