Loading...
Searching...
No Matches
gpr::policy::FreezeHyperparametersPolicy Class Reference

#include <gpr/policy/TrainingPolicy.h>

Inheritance diagram for gpr::policy::FreezeHyperparametersPolicy:

Public Member Functions

 FreezeHyperparametersPolicy (int freeze_after_oracle_calls)
int freeze_after_oracle_calls () const noexcept
bool should_retrain_hyperparameters (const SearchState &state) const override
Public Member Functions inherited from gpr::policy::TrainingPolicy
virtual ~TrainingPolicy ()=default
virtual bool should_call_oracle (const SearchState &state) const
 True asks the engine to make the call it was about to make.
virtual std::vector< int > select_training_points (const std::vector< CandidatePoint > &candidates, const std::vector< Eigen::VectorXd > &current_set) const
virtual bool should_rebuild_factor (const SearchState &state) const
virtual std::vector< int > retain_training_rows (const std::vector< Eigen::VectorXd > &rows) const

Detailed Description

Skip hyperparameter optimisation once freeze_after_oracle_calls oracle calls have been made. The factor is still updated. A negative count is rejected. Zero freezes before the first fit and leaves the seeded hyperparameters in place.

Definition at line 536 of file TrainingPolicy.h.

Constructor & Destructor Documentation

◆ FreezeHyperparametersPolicy()

gpr::policy::FreezeHyperparametersPolicy::FreezeHyperparametersPolicy ( int freeze_after_oracle_calls)
inlineexplicit

Definition at line 538 of file TrainingPolicy.h.

539 : freeze_after_oracle_calls_(freeze_after_oracle_calls)
540 {
542 throw std::invalid_argument(
543 "FreezeHyperparametersPolicy freeze_after_oracle_calls "
544 "must be non-negative");
545 }
546 }

Member Function Documentation

◆ freeze_after_oracle_calls()

int gpr::policy::FreezeHyperparametersPolicy::freeze_after_oracle_calls ( ) const
inlinenodiscardnoexcept

Definition at line 548 of file TrainingPolicy.h.

549 {
550 return freeze_after_oracle_calls_;
551 }

◆ should_retrain_hyperparameters()

bool gpr::policy::FreezeHyperparametersPolicy::should_retrain_hyperparameters ( const SearchState & state) const
inlineoverridevirtual

True runs hyperparameter optimisation. False keeps the current hyperparameters and still updates the factor.

Reimplemented from gpr::policy::TrainingPolicy.

Definition at line 553 of file TrainingPolicy.h.

554 {
555 if (!state.engine_would_retrain) return false;
556 return state.oracle_calls < freeze_after_oracle_calls_;
557 }

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