Ignore:
Timestamp:
Nov 4, 2016, 9:37:50 AM (8 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_StructOpt_integration_tests, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_ChronosMutex, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, GeometryObjects, Gui_displays_atomic_force_velocity, IndependentFragmentGrids_IntegrationTest, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, RotateToPrincipalAxisSystem_UndoRedo, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, ThirdParty_MPQC_rebuilt_buildsystem, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, Ubuntu_1604_changes, stable
Children:
c5e75f3
Parents:
e47ac7
git-author:
Frederik Heber <heber@…> (10/02/16 14:03:57)
git-committer:
Frederik Heber <heber@…> (11/04/16 09:37:50)
Message:

FIX: TrainingData used charges instead of atomic numbers to recognize fragments.

  • this only works if we do not DoSampleValenceOnly. Otherwise charges are no longer directly associable with the atomic number of the nuclei.
  • Extractors::gatherAllSymmetricDistanceArguments now needs atomicnumbers instead of charges.
  • TESTFIX: needed to adapt ExtractorsUnitTest.
Location:
src/FunctionApproximation
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/FunctionApproximation/Extractors.cpp

    re47ac7 rc7aac9  
    5959Extractors::gatherAllSymmetricDistanceArguments(
    6060    const Fragment::positions_t& positions,
    61     const Fragment::charges_t& charges,
     61    const Fragment::atomicnumbers_t& atomicnumbers,
    6262    const size_t globalid)
    6363{
     
    7676      arg.distance = firsttemp.distance(secondtemp);
    7777      arg.types = std::make_pair(
    78           charges[ std::distance(positions.begin(), firstpositer) ],
    79           charges[ std::distance(positions.begin(), secondpositer) ]
     78          (int)atomicnumbers[ std::distance(positions.begin(), firstpositer) ],
     79          (int)atomicnumbers[ std::distance(positions.begin(), secondpositer) ]
    8080          );
    8181      arg.indices = std::make_pair(
  • src/FunctionApproximation/Extractors.hpp

    re47ac7 rc7aac9  
    6969   *
    7070   * \param positions all nuclei positions
    71    * \param charges all nuclei charges
     71   * \param atomicNumber all nuclei atomic numbers
    7272   * \param globalid index to associated in argument_t with
    7373   * \return vector of argument_ , each with a distance
     
    7676  gatherAllSymmetricDistanceArguments(
    7777      const Fragment::positions_t& positions,
    78       const Fragment::charges_t& charges,
     78      const Fragment::atomicnumbers_t& atomicnumbers,
    7979      const size_t globalid);
    8080
     
    8383   *
    8484   * \param positions all nuclei positions
    85    * \param charges all nuclei charges
     85   * \param atomicNumber all nuclei atomic numbers
    8686   * \param index index refers to the index within the global set of configurations
    8787   * \return vector of of argument_t containing all found distances
     
    8989  inline FunctionModel::arguments_t gatherAllSymmetricDistances(
    9090      const Fragment::positions_t& positions,
    91       const Fragment::charges_t& charges,
     91      const Fragment::atomicnumbers_t& atomicnumbers,
    9292      const size_t index
    9393      ) {
    9494    // get distance out of Fragment
    95     return gatherAllSymmetricDistanceArguments(positions, charges, index);
     95    return gatherAllSymmetricDistanceArguments(positions, atomicnumbers, index);
    9696  }
    9797
  • src/FunctionApproximation/TrainingData.cpp

    re47ac7 rc7aac9  
    5858  for (HomologyContainer::const_iterator iter = range.first; iter != range.second; ++iter) {
    5959    const Fragment &fragment = iter->second.fragment;
    60     // create internal list of arguments
    6160    FunctionModel::arguments_t all_args = Extractors::gatherAllSymmetricDistances(
    6261        fragment.getPositions(),
    63         fragment.getCharges(),
     62        fragment.getAtomicNumbers(),
    6463        DistanceVector.size()
    6564        );
  • src/FunctionApproximation/unittests/ExtractorsUnitTest.cpp

    re47ac7 rc7aac9  
    8585
    8686  // create charges
    87   Fragment::charges_t charges;
    88   charges += 6., 6., 1., 1., 1.;
     87  Fragment::atomicnumbers_t atomicnumbers;
     88  atomicnumbers += 6, 6, 1, 1, 1;
    8989
    9090  // create distances
    9191  FunctionModel::arguments_t args =
    92       Extractors::gatherAllSymmetricDistances(positions, charges, 0);
     92      Extractors::gatherAllSymmetricDistances(positions, atomicnumbers, 0);
    9393  CPPUNIT_ASSERT_EQUAL( (size_t)(5*4/2), args.size() );
    9494
Note: See TracChangeset for help on using the changeset viewer.