oa::Optimizer

base Optimizer

Public Methods

oa::F32 oa::Optimizer::getLr()
oa::U64 oa::Optimizer::getStep()
oa::Status oa::Optimizer::loadFrom(Engine & inEngine, const ModelFile & inFile)
oa::F32 oa::Optimizer::lr()
void oa::Optimizer::notifyProgramReplay(oa::U64 inCount = 1)
oa::Status oa::Optimizer::saveTo(Engine & inEngine, ModelFile & outFile)
void oa::Optimizer::setLr(oa::F32 inLr)
void oa::Optimizer::step()
oa::Status oa::Optimizer::validateLoad(const ModelFile & inFile)
void oa::Optimizer::zeroGrad()

Constructor & Destructor Documentation

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

Public Method Documentation

oa::F32 oa::Optimizer::getLr()
No public source comment is attached to this declaration.

Returns

oa::F32

The declared return value.

oa::U64 oa::Optimizer::getStep()
current step count.

Returns

oa::U64

The declared return value.

oa::Status oa::Optimizer::loadFrom( Engine & inEngine, const ModelFile & inFile )
No public source comment is attached to this declaration.

Parameters

inEngine
Engine &

inFile
const ModelFile &

Returns

oa::Status

The declared return value.

oa::F32 oa::Optimizer::lr()
No public source comment is attached to this declaration.

Returns

oa::F32

The declared return value.

void oa::Optimizer::notifyProgramReplay( oa::U64 inCount = 1 )
A compiled training program executes the already-recorded optimizer kernels without calling step() again. Keep the host-visible logical step aligned so schedules and checkpoints observe the same state as eager execution.

Parameters

inCount
oa::U64

Default: 1

Returns

void

The declared return value.

oa::Status oa::Optimizer::saveTo( Engine & inEngine, ModelFile & outFile )
Persistence — write/read optimizer state (moments, step count, hyperparams) into a ModelFile section. Default no-op so SGD/Adam compile until they implement.

Parameters

inEngine
Engine &

outFile
ModelFile &

Returns

oa::Status

The declared return value.

void oa::Optimizer::setLr( oa::F32 inLr )
get/set learning rate.

Parameters

inLr
oa::F32

Returns

void

The declared return value.

void oa::Optimizer::step()
apply accumulated gradients to parameters.

Returns

void

The declared return value.

oa::Status oa::Optimizer::validateLoad( const ModelFile & inFile )
No public source comment is attached to this declaration.

Parameters

inFile
const ModelFile &

Returns

oa::Status

The declared return value.

void oa::Optimizer::zeroGrad()
Zero all gradients.

Returns

void

The declared return value.