![]() |
Rosetta
2021.16
|
OptE mode multifunction class. More...
#include <OptEMultifunc.hh>

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< Real > | get_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< Real > | starting_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... | |
| Multifunc & | operator= (Multifunc const &) |
| Copy assignment. More... | |
OptE mode multifunction class.
| 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 | ||
| ) |
References distribute_over_mpi_, mpi_nprocs_, and mpi_rank_.
| 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 | ||
| ) |
References distribute_over_mpi_, mpi_nprocs_, and mpi_rank_.
|
overridedefault |
Destructor.
| 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().
|
overridevirtual |
OptE dfunc.
OptE dfunc – gets the partial derivatives of func for each dimension being minimized.
Implements core::optimization::Multifunc.
References component_weights_, distribute_over_mpi_, core::chemical::element::F, fix_reference_energies_, fixed_score_list_, fixed_terms_, mpi_broadcast_eval_dfunc(), mpi_rank_, mpi_receive_dfunc(), 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().
|
inline |
References fix_reference_energies_.
Referenced by protocols::optimize_weights::IterativeOptEDriver::optimize_weights().
|
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 |
References fix_reference_energies_, num_energy_dofs_, num_ref_dofs_, and starting_reference_energies_.
Referenced by protocols::optimize_weights::IterativeOptEDriver::optimize_weights().
|
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().
|
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()().
|
private |
Referenced by wait_for_remote_vars().
|
private |
Referenced by mpi_broadcast_eval_dfunc(), and mpi_broadcast_eval_func().
|
private |
collect dfunc valresultsues from remote nodes and increment the values in the dE_dvars input array.
References mpi_nprocs_.
Referenced by dfunc().
|
private |
collect func values from remote nodes and return their sum.
References mpi_nprocs_, and protocols::analysis::total.
Referenced by operator()().
|
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().
|
inline |
References starting_reference_energies_.
| void protocols::optimize_weights::OptEMultifunc::wait_for_remote_vars | ( | ) | const |
Non-driver node wait for MPI vars to evaluate either the func or the dfunc.
References dfunc(), protocols::optimize_weights::END_OF_MINIMIZATION, protocols::optimize_weights::EVAL_DFUNC, protocols::optimize_weights::EVAL_FUNC, mpi_broadcast_receive_vars(), and operator()().
Referenced by protocols::optimize_weights::IterativeOptEDriver::optimize_weights().
|
private |
Referenced by dfunc(), and operator()().
|
private |
Referenced by dfunc(), operator()(), and OptEMultifunc().
|
private |
Referenced by dfunc(), fix_reference_energies(), get_dofs_from_energy_map(), get_reference_energies_from_dofs(), and operator()().
|
private |
Referenced by dfunc(), get_energy_map_from_dofs(), and operator()().
|
private |
Referenced by dfunc(), get_energy_map_from_dofs(), and operator()().
|
private |
Referenced by mpi_receive_dfunc(), mpi_receive_func(), and OptEMultifunc().
|
private |
Referenced by dfunc(), operator()(), and OptEMultifunc().
|
private |
Referenced by dfunc(), get_dofs_from_energy_map(), get_reference_energies_from_dofs(), and operator()().
|
private |
Referenced by dfunc(), get_reference_energies_from_dofs(), and operator()().
|
private |
Referenced by dfunc(), get_dofs_from_energy_map(), and operator()().
|
private |
Rotamer energy components for all positions.
Referenced by dfunc(), and operator()().
|
private |
Referenced by dfunc(), get_dofs_from_energy_map(), get_energy_map_from_dofs(), and operator()().
|
private |
1.8.7