oa::TrainingSession

TrainingSession class in the OA Ml public surface.

Public Methods

oa::Result<oa::U64> oa::TrainingSession::checkpoint(oa::U64 inExpectedRevision = 0)
TrainingSnapshot oa::TrainingSession::currentSnapshot()
oa::Result<oa::U64> oa::TrainingSession::enqueue(TrainingCommand inCommand)
oa::Result<oa::U64> oa::TrainingSession::evaluate(oa::U64 inExpectedRevision = 0)
oa::Optional<TrainingSnapshot> oa::TrainingSession::latestSnapshot()
void oa::TrainingSession::onFinished(const oa::Status & inStatus, const oa::ItTraining & inTraining)
void oa::TrainingSession::onReset(const oa::ItTraining & inTraining)
void oa::TrainingSession::onStepCompleted(const oa::ItTraining & inTraining)
oa::Optional<TrainingValue> oa::TrainingSession::parameter(oa::StringView inName)
oa::Result<oa::U64> oa::TrainingSession::pause(oa::U64 inExpectedRevision = 0)
oa::Status oa::TrainingSession::poll()
void oa::TrainingSession::publishMetric(oa::String inName, oa::F64 inValue)
oa::Status oa::TrainingSession::registerParameter(TrainingParameterDesc inDesc)
oa::Result<oa::U64> oa::TrainingSession::requestRebuild(TrainingValue inConfig, oa::U64 inExpectedRevision = 0)
oa::Result<oa::U64> oa::TrainingSession::requestRecapture(oa::U64 inExpectedRevision = 0)
oa::Vector<TrainingCommandResult> oa::TrainingSession::resultsAfter(oa::U64 inSequence)
oa::Result<oa::U64> oa::TrainingSession::resume(oa::U64 inExpectedRevision = 0)
oa::U64 oa::TrainingSession::revision()
oa::Result<oa::U64> oa::TrainingSession::setParameter(oa::String inName, TrainingValue inValue, oa::U64 inExpectedRevision = 0)
TrainingState oa::TrainingSession::state()
oa::Result<oa::U64> oa::TrainingSession::stop(oa::U64 inExpectedRevision = 0)
oa::Vector<TrainingCommandResult> oa::TrainingSession::takeResults()
bool oa::TrainingSession::tryBeginStep()
bool oa::TrainingSession::waitBeginStep()

Constructor & Destructor Documentation

oa::TrainingSession::TrainingSession( oa::ItTraining & inTraining, TrainingSessionConfig inConfig = {} )
No public source comment is attached to this declaration.

Parameters

inTraining
oa::ItTraining &

inConfig
TrainingSessionConfig

Default: {}

void oa::TrainingSession::~TrainingSession()
No public source comment is attached to this declaration.

Public Method Documentation

oa::Result<oa::U64> oa::TrainingSession::checkpoint( oa::U64 inExpectedRevision = 0 )
No public source comment is attached to this declaration.

Parameters

inExpectedRevision
oa::U64

Default: 0

Returns

oa::Result<oa::U64>

The declared return value.

TrainingSnapshot oa::TrainingSession::currentSnapshot()
Atomically combines the live state/revision with the most recently published step metrics. Unlike latestSnapshot(), this reflects commands applied since the last completed training step.

Returns

TrainingSnapshot

The declared return value.

oa::Result<oa::U64> oa::TrainingSession::enqueue( TrainingCommand inCommand )
Enqueue is non-blocking. A full queue rejects the command explicitly.

Parameters

inCommand
TrainingCommand

Returns

oa::Result<oa::U64>

The declared return value.

oa::Result<oa::U64> oa::TrainingSession::evaluate( oa::U64 inExpectedRevision = 0 )
No public source comment is attached to this declaration.

Parameters

inExpectedRevision
oa::U64

Default: 0

Returns

oa::Result<oa::U64>

The declared return value.

oa::Optional<TrainingSnapshot> oa::TrainingSession::latestSnapshot()
No public source comment is attached to this declaration.

Returns

oa::Optional<TrainingSnapshot>

The declared return value.

void oa::TrainingSession::onFinished( const oa::Status & inStatus, const oa::ItTraining & inTraining )
No public source comment is attached to this declaration.

Parameters

inStatus
const oa::Status &

inTraining
const oa::ItTraining &

Returns

void

The declared return value.

void oa::TrainingSession::onReset( const oa::ItTraining & inTraining )
No public source comment is attached to this declaration.

Parameters

inTraining
const oa::ItTraining &

Returns

void

The declared return value.

void oa::TrainingSession::onStepCompleted( const oa::ItTraining & inTraining )
Called by oa::ItTraining after a completed step/reset/finish. Public for custom iterator adapters, but ordinary callers do not invoke these.

Parameters

inTraining
const oa::ItTraining &

Returns

void

The declared return value.

oa::Optional<TrainingValue> oa::TrainingSession::parameter( oa::StringView inName )
No public source comment is attached to this declaration.

Parameters

inName
oa::StringView

Returns

oa::Optional<TrainingValue>

The declared return value.

oa::Result<oa::U64> oa::TrainingSession::pause( oa::U64 inExpectedRevision = 0 )
No public source comment is attached to this declaration.

Parameters

inExpectedRevision
oa::U64

Default: 0

Returns

oa::Result<oa::U64>

The declared return value.

oa::Status oa::TrainingSession::poll()
apply commands without advancing the training iterator.

Returns

oa::Status

The declared return value.

void oa::TrainingSession::publishMetric( oa::String inName, oa::F64 inValue )
No public source comment is attached to this declaration.

Parameters

inName
oa::String

inValue
oa::F64

Returns

void

The declared return value.

oa::Status oa::TrainingSession::registerParameter( TrainingParameterDesc inDesc )
No public source comment is attached to this declaration.

Parameters

inDesc
TrainingParameterDesc

Returns

oa::Status

The declared return value.

oa::Result<oa::U64> oa::TrainingSession::requestRebuild( TrainingValue inConfig, oa::U64 inExpectedRevision = 0 )
No public source comment is attached to this declaration.

Parameters

inConfig
TrainingValue

inExpectedRevision
oa::U64

Default: 0

Returns

oa::Result<oa::U64>

The declared return value.

oa::Result<oa::U64> oa::TrainingSession::requestRecapture( oa::U64 inExpectedRevision = 0 )
No public source comment is attached to this declaration.

Parameters

inExpectedRevision
oa::U64

Default: 0

Returns

oa::Result<oa::U64>

The declared return value.

oa::Vector<TrainingCommandResult> oa::TrainingSession::resultsAfter( oa::U64 inSequence )
Non-destructive bounded result view for independent observers such as a viewer and MCP client. results older than the configured ring capacity may have been dropped; callers advance their own sequence cursor.

Parameters

inSequence
oa::U64

Returns

oa::Vector<TrainingCommandResult>

The declared return value.

oa::Result<oa::U64> oa::TrainingSession::resume( oa::U64 inExpectedRevision = 0 )
No public source comment is attached to this declaration.

Parameters

inExpectedRevision
oa::U64

Default: 0

Returns

oa::Result<oa::U64>

The declared return value.

oa::U64 oa::TrainingSession::revision()
No public source comment is attached to this declaration.

Returns

oa::U64

The declared return value.

oa::Result<oa::U64> oa::TrainingSession::setParameter( oa::String inName, TrainingValue inValue, oa::U64 inExpectedRevision = 0 )
No public source comment is attached to this declaration.

Parameters

inName
oa::String

inValue
TrainingValue

inExpectedRevision
oa::U64

Default: 0

Returns

oa::Result<oa::U64>

The declared return value.

TrainingState oa::TrainingSession::state()
No public source comment is attached to this declaration.

Returns

TrainingState

The declared return value.

oa::Result<oa::U64> oa::TrainingSession::stop( oa::U64 inExpectedRevision = 0 )
No public source comment is attached to this declaration.

Parameters

inExpectedRevision
oa::U64

Default: 0

Returns

oa::Result<oa::U64>

The declared return value.

oa::Vector<TrainingCommandResult> oa::TrainingSession::takeResults()
No public source comment is attached to this declaration.

Returns

oa::Vector<TrainingCommandResult>

The declared return value.

bool oa::TrainingSession::tryBeginStep()
Non-blocking safe point for UI/event-loop owned training. Returns true only when one ordinary training step may begin now.

Returns

bool

The declared return value.

bool oa::TrainingSession::waitBeginStep()
Blocking safe point for a dedicated training thread. Enqueued resume/stop commands wake the wait without polling.

Returns

bool

The declared return value.