Rosetta  2020.46
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
protocols::optimize_weights::OptEMultifunc Class Reference

OptE mode multifunction class. More...

#include <OptEMultifunc.hh>

Inheritance diagram for protocols::optimize_weights::OptEMultifunc:
Inheritance graph
[legend]

Public Types

typedef core::scoring::ScoreTypes ScoreTypes
 
typedef core::scoring::EnergyMap EnergyMap
 
typedef
core::optimization::Multivec 
Multivec
 
typedef core::Real Real
 
typedef core::Size Size
 
- Public Types inherited from core::optimization::Multifunc
typedef utility::VirtualBase parent
 

Public Member Functions

 OptEMultifunc (OptEData &opte_data_in, EnergyMap const &fixed_terms_in, int num_free_in, ScoreTypes &score_list_in, ScoreTypes &fixed_score_list_in, Multivec const &component_weights)
 
 OptEMultifunc (OptEData &opte_data_in, EnergyMap const &fixed_terms_in, int num_free_in, ScoreTypes const &score_list_in, ScoreTypes const &fixed_score_list_in, utility::vector1< Real > const &reference_energies_in, Multivec const &component_weights)
 
 ~OptEMultifunc () override=default
 Destructor. More...
 
Real operator() (Multivec const &vars) const override
 The objective function for optE. Called in IterativeOptEDriver when optimizing the weights. Sums over all of the PositionData objects in the OptEData object, and calls get_score() on each of them. Each PositionData object implements print_score() and get_score() methods that print/return how good a weight set is for optimizing the metric that PositionData object represents. More...
 
void dfunc (Multivec const &vars, Multivec &dE_dvars) const override
 OptE dfunc. More...
 
Multivec get_dofs_from_energy_map (EnergyMap const &start_vals) const
 Does actual work for OptE minimization. More...
 
EnergyMap get_energy_map_from_dofs (Multivec const &dofs) const
 Expand free variables and combine with fixed to make an Energy Map. More...
 
utility::vector1< Realget_reference_energies_from_dofs (Multivec const &dofs) const
 
void set_starting_reference_energies (utility::vector1< Real > const &values)
 
void wait_for_remote_vars () const
 Non-driver node wait for MPI vars to evaluate either the func or the dfunc. More...
 
void declare_minimization_over () const
 For driver node: inform the non-driver nodes that minimization is over. Must be called before object is destructed (Should not be called in the destructor, as dstors should not throw exceptions, and MPI communication can absolutely result in exceptions). More...
 
void fix_reference_energies (bool setting)
 
bool fix_reference_energies () const
 Are the reference energies being optimized at all, or are they being held fixed? More...
 
- Public Member Functions inherited from core::optimization::Multifunc
 ~Multifunc () override=default
 Destructor. More...
 
virtual bool abort_min (Multivec const &) const
 Christophe added the following to allow premature end of minimization If you want to abort the minimizer under specific circonstances overload this function and return true if you want to stop, false if you want to continue. FOR THE MOMENT, ONLY IN DFPMIN! More...
 
virtual void dump (Multivec const &, Multivec const &) const
 Error state reached – derivative does not match gradient Derived classes have the oportunity to now output and or analyze the two vars assignments vars, vars+delta where the derivatives are incorrect. More...
 

Private Member Functions

void mpi_broadcast_eval_func (Multivec const &vars) const
 send out messages over MPI for remote nodes to evaluate their func given the input vars. More...
 
void mpi_broadcast_eval_dfunc (Multivec const &vars) const
 send out messages over MPI for remote nodes to evaluate their dfunc given the input vars. More...
 
void mpi_broadcast_send_vars (Multivec const &vars) const
 
void mpi_broadcast_receive_vars (Multivec &vars) const
 
Real mpi_receive_func () const
 collect func values from remote nodes and return their sum. More...
 
void mpi_receive_dfunc (Multivec &dE_vars) const
 collect dfunc valresultsues from remote nodes and increment the values in the dE_dvars input array. More...
 

Private Attributes

core::Size const num_energy_dofs_
 
int const num_ref_dofs_
 
int const num_total_dofs_
 
OptEData const & opte_data_
 Rotamer energy components for all positions. More...
 
EnergyMap const & fixed_terms_
 
ScoreTypes const & score_list_
 
ScoreTypes const & fixed_score_list_
 
bool fix_reference_energies_
 
utility::vector1< Realstarting_reference_energies_
 
Multivec component_weights_
 
int mpi_rank_
 
int mpi_nprocs_
 
bool distribute_over_mpi_
 

Additional Inherited Members

- Protected Member Functions inherited from core::optimization::Multifunc
 Multifunc ()
 Default constructor. More...
 
 Multifunc (Multifunc const &)
 Copy constructor. More...
 
Multifuncoperator= (Multifunc const &)
 Copy assignment. More...
 

Detailed Description

OptE mode multifunction class.

Member Typedef Documentation

Constructor & Destructor Documentation

protocols::optimize_weights::OptEMultifunc::OptEMultifunc ( OptEData opte_data_in,
EnergyMap const &  fixed_terms_in,
int  num_free_in,
ScoreTypes score_list_in,
ScoreTypes fixed_score_list_in,
Multivec const &  component_weights 
)
protocols::optimize_weights::OptEMultifunc::OptEMultifunc ( OptEData opte_data_in,
EnergyMap const &  fixed_terms_in,
int  num_free_in,
ScoreTypes const &  score_list_in,
ScoreTypes const &  fixed_score_list_in,
utility::vector1< Real > const &  reference_energies_in,
Multivec const &  component_weights 
)
protocols::optimize_weights::OptEMultifunc::~OptEMultifunc ( )
overridedefault

Destructor.

Member Function Documentation

void protocols::optimize_weights::OptEMultifunc::declare_minimization_over ( ) const

For driver node: inform the non-driver nodes that minimization is over. Must be called before object is destructed (Should not be called in the destructor, as dstors should not throw exceptions, and MPI communication can absolutely result in exceptions).

References protocols::optimize_weights::END_OF_MINIMIZATION.

Referenced by protocols::optimize_weights::IterativeOptEDriver::optimize_weights().

void protocols::optimize_weights::OptEMultifunc::dfunc ( Multivec const &  vars,
Multivec dE_dvars 
) const
overridevirtual
void protocols::optimize_weights::OptEMultifunc::fix_reference_energies ( bool  setting)
inline
bool protocols::optimize_weights::OptEMultifunc::fix_reference_energies ( ) const
inline

Are the reference energies being optimized at all, or are they being held fixed?

References fix_reference_energies_.

Multivec protocols::optimize_weights::OptEMultifunc::get_dofs_from_energy_map ( EnergyMap const &  start_vals) const

Does actual work for OptE minimization.

Extract variable weights from an Energy Map.

Extract variable weights from an Energy Map

References fix_reference_energies_, num_energy_dofs_, num_total_dofs_, score_list_, and starting_reference_energies_.

Referenced by protocols::optimize_weights::IterativeOptEDriver::optimize_weights().

EnergyMap protocols::optimize_weights::OptEMultifunc::get_energy_map_from_dofs ( Multivec const &  dofs) const

Expand free variables and combine with fixed to make an Energy Map.

Expand free variables and combine with fixed to make an Energy Map. Used by the IterativeOptEDriver at the end of weight minimization to create an EnergyMap that uses the new weight set. This EnergyMap then gets output into a optE log file.

References fixed_score_list_, fixed_terms_, and score_list_.

Referenced by protocols::optimize_weights::IterativeOptEDriver::optimize_weights().

utility::vector1< Real > protocols::optimize_weights::OptEMultifunc::get_reference_energies_from_dofs ( Multivec const &  dofs) const
void protocols::optimize_weights::OptEMultifunc::mpi_broadcast_eval_dfunc ( Multivec const &  vars) const
private

send out messages over MPI for remote nodes to evaluate their dfunc given the input vars.

References protocols::optimize_weights::EVAL_DFUNC, and mpi_broadcast_send_vars().

Referenced by dfunc().

void protocols::optimize_weights::OptEMultifunc::mpi_broadcast_eval_func ( Multivec const &  vars) const
private

send out messages over MPI for remote nodes to evaluate their func given the input vars.

References protocols::optimize_weights::EVAL_FUNC, and mpi_broadcast_send_vars().

Referenced by operator()().

void protocols::optimize_weights::OptEMultifunc::mpi_broadcast_receive_vars ( Multivec vars) const
private

Referenced by wait_for_remote_vars().

void protocols::optimize_weights::OptEMultifunc::mpi_broadcast_send_vars ( Multivec const &  vars) const
private
void protocols::optimize_weights::OptEMultifunc::mpi_receive_dfunc ( Multivec dE_vars) const
private

collect dfunc valresultsues from remote nodes and increment the values in the dE_dvars input array.

References mpi_nprocs_.

Referenced by dfunc().

Real protocols::optimize_weights::OptEMultifunc::mpi_receive_func ( ) const
private

collect func values from remote nodes and return their sum.

References mpi_nprocs_, and protocols::analysis::total.

Referenced by operator()().

Real protocols::optimize_weights::OptEMultifunc::operator() ( Multivec const &  vars) const
overridevirtual

The objective function for optE. Called in IterativeOptEDriver when optimizing the weights. Sums over all of the PositionData objects in the OptEData object, and calls get_score() on each of them. Each PositionData object implements print_score() and get_score() methods that print/return how good a weight set is for optimizing the metric that PositionData object represents.

Implements core::optimization::Multifunc.

References component_weights_, distribute_over_mpi_, fix_reference_energies_, fixed_score_list_, fixed_terms_, mpi_broadcast_eval_func(), mpi_rank_, mpi_receive_func(), num_energy_dofs_, num_ref_dofs_, num_total_dofs_, opte_data_, protocols::optimize_weights::OptEPositionDataFactory::optE_type_name(), protocols::optimize_weights::OptEData::position_data_begin(), protocols::optimize_weights::OptEData::position_data_end(), protocols::hybridization::score, score_list_, starting_reference_energies_, and protocols::optimize_weights::TR().

Referenced by wait_for_remote_vars().

void protocols::optimize_weights::OptEMultifunc::set_starting_reference_energies ( utility::vector1< Real > const &  values)
inline
void protocols::optimize_weights::OptEMultifunc::wait_for_remote_vars ( ) const

Member Data Documentation

Multivec protocols::optimize_weights::OptEMultifunc::component_weights_
private

Referenced by dfunc(), and operator()().

bool protocols::optimize_weights::OptEMultifunc::distribute_over_mpi_
private

Referenced by dfunc(), operator()(), and OptEMultifunc().

bool protocols::optimize_weights::OptEMultifunc::fix_reference_energies_
private
ScoreTypes const& protocols::optimize_weights::OptEMultifunc::fixed_score_list_
private
EnergyMap const& protocols::optimize_weights::OptEMultifunc::fixed_terms_
private
int protocols::optimize_weights::OptEMultifunc::mpi_nprocs_
private
int protocols::optimize_weights::OptEMultifunc::mpi_rank_
private

Referenced by dfunc(), operator()(), and OptEMultifunc().

core::Size const protocols::optimize_weights::OptEMultifunc::num_energy_dofs_
private
int const protocols::optimize_weights::OptEMultifunc::num_ref_dofs_
private
int const protocols::optimize_weights::OptEMultifunc::num_total_dofs_
private
OptEData const& protocols::optimize_weights::OptEMultifunc::opte_data_
private

Rotamer energy components for all positions.

Referenced by dfunc(), and operator()().

ScoreTypes const& protocols::optimize_weights::OptEMultifunc::score_list_
private
utility::vector1< Real > protocols::optimize_weights::OptEMultifunc::starting_reference_energies_
private

The documentation for this class was generated from the following files: