class pot::ActiveGP

Overview

#include <gpr/potentials/ActiveGP.h>
 
class ActiveGP {
public:
    // typedefs
 
    typedef std::function<int(long n_atoms, const double*positions, const int*atomic_nrs, const double*box, double*energy, double*forces)> OracleFn;
    typedef std::function<void(AcquireReason)> AcquireHook;
    typedef std::function<void(std::uint64_t epoch)> ModelUpdateHook;
    typedef ActiveGPConfig Config;
 
    // enums
 
    enum AcquireReason;
 
    // construction
 
    ActiveGP(std::shared_ptr<gpr::neb::ActiveLearningSession> session, OracleFn oracle, Config config = Config());
 
    // methods
 
    std::uint64_t modelState() const;
    long trainingSize() const;
    long oracleCalls() const;
    void setAcquireHook(AcquireHook hook);
    void setModelUpdateHook(ModelUpdateHook hook);
    int force(long n_atoms, const double* positions, const int* atomic_nrs, double* forces, double* energy, double* variance, const double* box);
    int forceBatch(long n_systems, long n_atoms, const double* positions, const int* atomic_nrs, double* forces, double* energies, double* variances, const double* boxes);
    void incorporate();
};

Detailed Documentation

Typedefs

typedef std::function<int(long n_atoms, const double*positions, const int*atomic_nrs, const double*box, double*energy, double*forces)> OracleFn

Ground truth. Returns 0 on success, positive recoverable, negative fatal, matching the engine ABI convention.

typedef std::function<void(std::uint64_t epoch)> ModelUpdateHook

Fired after an incorporation changed the surface.

Methods

std::uint64_t modelState() const

Monotone surface epoch: changes only when an incorporation changes the posterior. Host caches key on this.

long trainingSize() const

Training rows currently held.

long oracleCalls() const

Oracle calls made through this surrogate.

int force(long n_atoms, const double* positions, const int* atomic_nrs, double* forces, double* energy, double* variance, const double* box)

LOTF force. Returns 0 on success; a nonzero oracle return is propagated unchanged.

int forceBatch(long n_systems, long n_atoms, const double* positions, const int* atomic_nrs, double* forces, double* energies, double* variances, const double* boxes)

Batched channel and incorporation boundary. Every system is predicted; the least resolved one above the gate is delegated to the oracle and learned, which is OIE-class argmax-variance acquisition from inside a passive potential. Systems share one composition.

void incorporate()

Host-requested incorporation boundary (the ABI hint channel).