class gpr::optim::SecantHessian

Overview

Dense symmetric Hessian estimate carried by consecutive true gradients. More…

#include <gpr/optimization/SecantHessian.h>
 
class SecantHessian {
public:
    // construction
 
    SecantHessian(SecantHessianMethod method = SecantHessianMethod::Bofill);
 
    // methods
 
    void reset();
    bool observe(const Eigen::VectorXd& position, const Eigen::VectorXd& gradient);
    bool observe(const Eigen::VectorXd& position, const Eigen::VectorXd& gradient, double energy);
    void noteEnergy(double energy);
    bool hasReferenceEnergy() const;
    double referenceEnergy() const;
    bool available() const;
    std::size_t pairs() const;
    const Eigen::MatrixXd& hessian() const;
    const Eigen::VectorXd& referencePosition() const;
    const Eigen::VectorXd& referenceGradient() const;
    const Eigen::VectorXd& lastDirection() const;
    const Eigen::MatrixXd& measuredSteps() const;
    SecantConsistency consistency(const Eigen::VectorXd& posterior_action, double relative_tolerance) const;
    double meanEnergy(const Eigen::VectorXd& position, double reference_energy) const;
    Eigen::VectorXd meanGradient(const Eigen::VectorXd& position) const;
    static bool update(Eigen::MatrixXd& matrix, SecantHessianMethod method, const Eigen::VectorXd& step, const Eigen::VectorXd& gradient_change);
};

Detailed Documentation

Dense symmetric Hessian estimate carried by consecutive true gradients.

The first usable pair supplies the isotropic BFGS scale. SR1 and Bofill start from zero, which is already a valid symmetric prior. Failed updates are reported to the caller; methods are never substituted silently.

Methods

bool observe(const Eigen::VectorXd& position, const Eigen::VectorXd& gradient, double energy)

Observe a geometry together with its energy. The quadratic mean expands about the reference geometry, so the energy is kept only when this geometry becomes that reference: the first geometry, or an accepted pair. A refused pair leaves both the reference and its energy alone, and an accepted geometry whose energy is not finite leaves no reference energy rather than the previous geometry’s.

void noteEnergy(double energy)

Energy at the latest observed geometry. The quadratic mean expands about that point.

const Eigen::MatrixXd& measuredSteps() const

Orthonormal basis of all independent accepted step directions. Step lengths are removed before membership is tested, so the span is invariant to coordinate units and contains at most one column per degree of freedom.

static bool update(Eigen::MatrixXd& matrix, SecantHessianMethod method, const Eigen::VectorXd& step, const Eigen::VectorXd& gradient_change)

Apply one named direct-Hessian update to caller-owned state. False means that method’s own denominator/curvature condition failed.