oa::CbPhase

oa::CbPhase Multi-phase training callback. phases are consecutive ranges of epochs — build the iterator with oa::ItTrainingConfig::epochSteps so epoch boundaries follow the phase schedule, then register one addPhase() per phase in order. Prints a schedule preview at train begin and a phase banner + phase-relative epoch headers (disable the progress bar's own header via SetShowEpochHeader): phase schedule: 1. warmup — 1 epoch (2000 steps) 2. main — 10 epochs (20000 steps) phase 1/2 — warmup · 1 epoch × 2000 steps epoch 1/1 2000/2000 |██████████| ... The OnPhaseBegin hook fires on entering each phase (including the first) — use it to swap LR schedulers, change datasets, etc.

Public Types

Inheritance

public CbTraining · public Callback

Public Methods

void oa::CbPhase::addPhase(oa::String inId, oa::I64 inEpochs, oa::I64 inSteps)
oa::I32 oa::CbPhase::currentPhase()
void oa::CbPhase::onEpochBegin(oa::ItTraining & inIter)
void oa::CbPhase::onTrainBegin(oa::ItTraining & inIter)
void oa::CbPhase::setOnPhaseBegin(PhaseBeginFn inFn)

Public Method Documentation

void oa::CbPhase::addPhase( oa::String inId, oa::I64 inEpochs, oa::I64 inSteps )
No public source comment is attached to this declaration.

Parameters

inId
oa::String

inEpochs
oa::I64

inSteps
oa::I64

Returns

void

The declared return value.

oa::I32 oa::CbPhase::currentPhase()
No public source comment is attached to this declaration.

Returns

oa::I32

The declared return value.

void oa::CbPhase::onEpochBegin( oa::ItTraining & inIter )
No public source comment is attached to this declaration.

Parameters

inIter
oa::ItTraining &

Returns

void

The declared return value.

void oa::CbPhase::onTrainBegin( oa::ItTraining & inIter )
No public source comment is attached to this declaration.

Parameters

inIter
oa::ItTraining &

Returns

void

The declared return value.

void oa::CbPhase::setOnPhaseBegin( PhaseBeginFn inFn )
No public source comment is attached to this declaration.

Parameters

inFn
PhaseBeginFn

Returns

void

The declared return value.