Ignore:
Timestamp:
Feb 27, 2013, 12:39:03 PM (12 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, 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_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
Children:
775dd1a
Parents:
7b019a
git-author:
Frederik Heber <heber@…> (11/30/12 16:35:37)
git-committer:
Frederik Heber <heber@…> (02/27/13 12:39:03)
Message:

Extracted initial parameter setting per specific potential to FunctionModel::setParametersToRandomInitialValues().

  • this is preparatory for generalizing potential fitting.
Location:
src/Potentials/Specifics
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • src/Potentials/Specifics/ManyBodyPotential_Tersoff.cpp

    r7b019a rd52819  
    4949
    5050#include "FunctionApproximation/Extractors.hpp"
     51#include "FunctionApproximation/TrainingData.hpp"
    5152#include "Potentials/helpers.hpp"
    5253#include "Potentials/ParticleTypeCheckers.hpp"
     
    697698}
    698699
     700void
     701ManyBodyPotential_Tersoff::setParametersToRandomInitialValues(
     702    const TrainingData &data)
     703{
     704//  params[ManyBodyPotential_Tersoff::R] = 1./AtomicLengthToAngstroem;
     705//  params[ManyBodyPotential_Tersoff::S] = 2./AtomicLengthToAngstroem;
     706  params[ManyBodyPotential_Tersoff::A] = 1e+4*rand()/(double)RAND_MAX;//1.393600e+03;
     707  params[ManyBodyPotential_Tersoff::B] = 1e+4*rand()/(double)RAND_MAX;//3.467000e+02;
     708  params[ManyBodyPotential_Tersoff::lambda] = 1e+1*rand()/(double)RAND_MAX;//3.487900e+00;
     709  params[ManyBodyPotential_Tersoff::mu] = 1e+1*rand()/(double)RAND_MAX;//2.211900e+00;
     710  //  params[ManyBodyPotential_Tersoff::lambda3] = 0.;
     711  //  params[ManyBodyPotential_Tersoff::alpha] = 0.;
     712  params[ManyBodyPotential_Tersoff::beta] = 1e-1*rand()/(double)RAND_MAX;//1.572400e-07;
     713  //  params[ManyBodyPotential_Tersoff::chi] = 1.;
     714  //  params[ManyBodyPotential_Tersoff::omega] = 1.;
     715  params[ManyBodyPotential_Tersoff::n] = 1e+1*rand()/(double)RAND_MAX;//7.275100e-01;
     716  params[ManyBodyPotential_Tersoff::c] = 1e+1*rand()/(double)RAND_MAX;//3.804900e+04;
     717  params[ManyBodyPotential_Tersoff::d] = 1e+1*rand()/(double)RAND_MAX;//4.384000e+00;
     718  params[ManyBodyPotential_Tersoff::h] = 1e+1*rand()/(double)RAND_MAX;//-5.705800e-01;
     719  params[ManyBodyPotential_Tersoff::offset] = //0.*rand()/(double)RAND_MAX;//-5.705800e-01;
     720      data.getTrainingOutputAverage()[0];
     721}
     722
  • src/Potentials/Specifics/ManyBodyPotential_Tersoff.hpp

    r7b019a rd52819  
    2121#include "Potentials/SerializablePotential.hpp"
    2222#include "FunctionApproximation/FunctionModel.hpp"
     23
     24class TrainingData;
    2325
    2426/** This class is the implementation of the Tersoff potential function.
     
    318320  }
    319321
     322  /** Sets the parameter randomly within the sensible range of each parameter.
     323   *
     324   * \param data container with training data for guesstimating range
     325   */
     326  void setParametersToRandomInitialValues(const TrainingData &data);
     327
    320328  /** Getter for the number of parameters of this model function.
    321329   *
  • src/Potentials/Specifics/PairPotential_Angle.cpp

    r7b019a rd52819  
    4646
    4747#include "FunctionApproximation/Extractors.hpp"
     48#include "FunctionApproximation/TrainingData.hpp"
    4849#include "Potentials/helpers.hpp"
    4950#include "Potentials/ParticleTypeCheckers.hpp"
     
    219220}
    220221
     222void
     223PairPotential_Angle::setParametersToRandomInitialValues(
     224    const TrainingData &data)
     225{
     226  params[PairPotential_Angle::energy_offset] =
     227      data.getTrainingOutputAverage()[0];// -1.;
     228  params[PairPotential_Angle::spring_constant] = 1e+0*rand()/(double)RAND_MAX;// 0.2;
     229  params[PairPotential_Angle::equilibrium_distance] = -0.3;//2e+0*rand()/(double)RAND_MAX - 1.;// 1.;
     230}
     231
  • src/Potentials/Specifics/PairPotential_Angle.hpp

    r7b019a rd52819  
    2222#include "Potentials/SerializablePotential.hpp"
    2323#include "FunctionApproximation/FunctionModel.hpp"
     24
     25class TrainingData;
    2426
    2527/** This is the implementation of a harmonic angle potential.
     
    6466    return params;
    6567  }
     68
     69  /** Sets the parameter randomly within the sensible range of each parameter.
     70   *
     71   * \param data container with training data for guesstimating range
     72   */
     73  void setParametersToRandomInitialValues(const TrainingData &data);
    6674
    6775  /** Getter for the number of parameters of this model function.
  • src/Potentials/Specifics/PairPotential_Harmonic.cpp

    r7b019a rd52819  
    4646
    4747#include "FunctionApproximation/Extractors.hpp"
     48#include "FunctionApproximation/TrainingData.hpp"
    4849#include "Potentials/helpers.hpp"
    4950#include "Potentials/ParticleTypeCheckers.hpp"
     
    195196}
    196197
     198void
     199PairPotential_Harmonic::setParametersToRandomInitialValues(
     200    const TrainingData &data)
     201{
     202  params[PairPotential_Harmonic::energy_offset] =
     203      data.getTrainingOutputAverage()[0];// -1.;
     204  params[PairPotential_Harmonic::equilibrium_distance] = 3e+0*rand()/(double)RAND_MAX + .5;// 1.;
     205  params[PairPotential_Harmonic::spring_constant] = 1e+0*rand()/(double)RAND_MAX;// 0.2;
     206}
     207
  • src/Potentials/Specifics/PairPotential_Harmonic.hpp

    r7b019a rd52819  
    2222#include "Potentials/SerializablePotential.hpp"
    2323#include "FunctionApproximation/FunctionModel.hpp"
     24
     25class TrainingData;
    2426
    2527/** This is the implementation of a harmonic pair potential.
     
    6466    return params;
    6567  }
     68
     69  /** Sets the parameter randomly within the sensible range of each parameter.
     70   *
     71   * \param data container with training data for guesstimating range
     72   */
     73  void setParametersToRandomInitialValues(const TrainingData &data);
    6674
    6775  /** Getter for the number of parameters of this model function.
  • src/Potentials/Specifics/PairPotential_Morse.cpp

    r7b019a rd52819  
    4747
    4848#include "FunctionApproximation/Extractors.hpp"
     49#include "FunctionApproximation/TrainingData.hpp"
    4950#include "Potentials/helpers.hpp"
    5051#include "Potentials/ParticleTypeCheckers.hpp"
     
    224225}
    225226
     227void
     228PairPotential_Morse::setParametersToRandomInitialValues(
     229    const TrainingData &data)
     230{
     231  params[PairPotential_Morse::dissociation_energy] = 1e+0*rand()/(double)RAND_MAX;// 0.5;
     232  params[PairPotential_Morse::energy_offset] =
     233      data.getTrainingOutputAverage()[0];// -1.;
     234  params[PairPotential_Morse::spring_constant] = 1e+0*rand()/(double)RAND_MAX;// 1.;
     235  params[PairPotential_Morse::equilibrium_distance] =  3e+0*rand()/(double)RAND_MAX;//2.9;
     236}
     237
  • src/Potentials/Specifics/PairPotential_Morse.hpp

    r7b019a rd52819  
    2222#include "Potentials/SerializablePotential.hpp"
    2323#include "FunctionApproximation/FunctionModel.hpp"
     24
     25class TrainingData;
    2426
    2527/** This is the implementation of a harmonic pair potential.
     
    6567    return params;
    6668  }
     69
     70  /** Sets the parameter randomly within the sensible range of each parameter.
     71   *
     72   * \param data container with training data for guesstimating range
     73   */
     74  void setParametersToRandomInitialValues(const TrainingData &data);
    6775
    6876  /** Getter for the number of parameters of this model function.
  • src/Potentials/Specifics/SaturationPotential.cpp

    r7b019a rd52819  
    4848
    4949#include "FunctionApproximation/Extractors.hpp"
     50#include "FunctionApproximation/TrainingData.hpp"
    5051#include "Potentials/helpers.hpp"
    5152#include "Potentials/ParticleTypeCheckers.hpp"
     
    369370  return returnfunction;
    370371}
     372
     373void
     374SaturationPotential::setParametersToRandomInitialValues(
     375    const TrainingData &data)
     376{
     377  energy_offset = data.getTrainingOutputAverage()[0];
     378  morse.setParametersToRandomInitialValues(data);
     379  angle.setParametersToRandomInitialValues(data);
     380}
  • src/Potentials/Specifics/SaturationPotential.hpp

    r7b019a rd52819  
    2424#include "Potentials/Specifics/PairPotential_Morse.hpp"
    2525#include "FunctionApproximation/FunctionModel.hpp"
     26
     27class TrainingData;
    2628
    2729/** This is a combination of Morse and Angle potentials for saturated elements.
     
    7779  parameters_t getParameters() const;
    7880
     81  /** Sets the parameter randomly within the sensible range of each parameter.
     82   *
     83   * \param data container with training data for guesstimating range
     84   */
     85  void setParametersToRandomInitialValues(const TrainingData &data);
     86
    7987  /** Getter for the number of parameters of this model function.
    8088   *
  • src/Potentials/Specifics/unittests/Makefile.am

    r7b019a rd52819  
    2727        ../libMolecuilderPotentials.la \
    2828        ../libMolecuilderFragmentationSetValues.la \
     29        ../libMolecuilderFragmentation.la \
    2930        ../libMolecuilderFunctionApproximation.la \
    3031        $(top_builddir)/LinearAlgebra/src/LinearAlgebra/libLinearAlgebra.la \
Note: See TracChangeset for help on using the changeset viewer.