CorTeX Core ABI 7
ToolTech Software · C++ library reference
Loading...
Searching...
No Matches
ctxBackpropTrainer Class Reference

#include <ctxCortexTrainer.h>

Inheritance diagram for ctxBackpropTrainer:
ctxTrainer

Public Member Functions

virtual gzType * getType () const
 ctxBackpropTrainer (const ctxBackpropTrainingOptions &options=ctxBackpropTrainingOptions())
virtual ~ctxBackpropTrainer ()
gzBool setOptimizer (ctxOptimizer *optimizer, ctxOptimizerStatePolicy statePolicy=CTX_OPTIMIZER_STATE_RESET)
ctxOptimizer * getOptimizer () const
gzBool setDropConnect (gzFloat probability)
 Set the training DropConnect probability for subsequent batches.
gzFloat getDropConnect () const
gzBool prepare ()
gzBool trainStep ()
 Prepare and train the next bounded unit; Backprop consumes one batch.
gzBool isPrepared () const
gzBool isComplete () const
gzBool train ()
ctxTrainerProgramProfile getProgramProfile () const
gzUInt32 getCapabilities () const
gzBool beginEpoch (gzUInt32 epoch)
gzBool beginEpoch (gzUInt32 epoch, const gzArray< gzFloat > &sampleWeights, gzUInt32 seed=0)
 Explicit weighted epoch over the prepared training prefix, excluding validations.
gzBool beginIndexedEpoch (gzUInt32 epoch, const ctxIndex &sampleOrder)
 Install a prebuilt training-prefix order at an epoch boundary.
gzBool prepareNextBatch ()
 Prepare the next selected batch, without a parameter update.
gzBool trainPreparedBatch ()
 Train one prepared batch and commit its batch/epoch progress.
gzBool saveCheckpoint (const gzString &url) const
gzBool loadCheckpoint (const gzString &url)
gzUInt32 getSamples () const
gzUInt32 getValidations () const
gzUInt32 getBatchSize () const
gzUInt32 getSubsetLength () const
gzUInt32 getBatchOffset () const
gzUInt32 getSampleIndex (gzUInt32 page) const
gzUInt32 getIteration () const
Public Member Functions inherited from ctxTrainer
 ctxTrainer ()
virtual gzBool install (ctxCortex *cortex)
 Bind this session to one cortex.
ctxCortex * getCortex () const
gzString getError () const

Static Public Member Functions

static gzType * getClassType ()
Static Public Member Functions inherited from ctxTrainer
static gzType * getClassType ()

Friends

class ctxModel

Additional Inherited Members

Protected Attributes inherited from ctxTrainer
ctxCortexPtr m_cortex
gzString m_error

Detailed Description

Definition at line 178 of file ctxCortexTrainer.h.

Constructor & Destructor Documentation

◆ ctxBackpropTrainer()

ctxBackpropTrainer::ctxBackpropTrainer ( const ctxBackpropTrainingOptions & options = ctxBackpropTrainingOptions())

References CTX_EXPORT.

Referenced by ctxModel.

◆ ~ctxBackpropTrainer()

virtual ctxBackpropTrainer::~ctxBackpropTrainer ( )
virtual

References CTX_EXPORT.

Member Function Documentation

◆ beginEpoch() [1/2]

gzBool ctxBackpropTrainer::beginEpoch ( gzUInt32 epoch)

References CTX_EXPORT.

◆ beginEpoch() [2/2]

gzBool ctxBackpropTrainer::beginEpoch ( gzUInt32 epoch,
const gzArray< gzFloat > & sampleWeights,
gzUInt32 seed = 0 )

Explicit weighted epoch over the prepared training prefix, excluding validations.

Weights must contain getSamples()-getValidations() finite nonnegative entries and have a positive sum. Requires sequence=FALSE and an epoch boundary (no pending batch). The batch/epoch budget stays unchanged; sampling is with replacement and local seed/epoch state. Rejected calls leave the current sample order and progress unchanged. Checkpoints persist the chosen indices; callers retain/bind the weight policy and call this overload again for each subsequent weighted epoch.

References CTX_EXPORT.

◆ beginIndexedEpoch()

gzBool ctxBackpropTrainer::beginIndexedEpoch ( gzUInt32 epoch,
const ctxIndex & sampleOrder )

Install a prebuilt training-prefix order at an epoch boundary.

Requires non-sequential prepared training, no pending batch, and exactly getSubsetLength() indices below getSamples()-getValidations(). Invalid calls preserve selected indices, progress and parameter/optimizer banks. Checkpoints retain the order and batch cursor; bind/save the external generating policy separately. Automatic later epochs remain unweighted.

References CTX_EXPORT.

◆ getBatchOffset()

gzUInt32 ctxBackpropTrainer::getBatchOffset ( ) const

References CTX_EXPORT.

◆ getBatchSize()

gzUInt32 ctxBackpropTrainer::getBatchSize ( ) const

References CTX_EXPORT.

◆ getCapabilities()

gzUInt32 ctxBackpropTrainer::getCapabilities ( ) const
virtual

Implements ctxTrainer.

References CTX_EXPORT.

◆ getClassType()

gzType * ctxBackpropTrainer::getClassType ( )
static

References CTX_EXPORT.

◆ getDropConnect()

gzFloat ctxBackpropTrainer::getDropConnect ( ) const

References CTX_EXPORT.

◆ getIteration()

gzUInt32 ctxBackpropTrainer::getIteration ( ) const

References CTX_EXPORT.

◆ getOptimizer()

ctxOptimizer * ctxBackpropTrainer::getOptimizer ( ) const

References CTX_EXPORT.

◆ getProgramProfile()

ctxTrainerProgramProfile ctxBackpropTrainer::getProgramProfile ( ) const
virtual

Implements ctxTrainer.

References CTX_EXPORT.

◆ getSampleIndex()

gzUInt32 ctxBackpropTrainer::getSampleIndex ( gzUInt32 page) const

References CTX_EXPORT.

◆ getSamples()

gzUInt32 ctxBackpropTrainer::getSamples ( ) const

References CTX_EXPORT.

◆ getSubsetLength()

gzUInt32 ctxBackpropTrainer::getSubsetLength ( ) const

References CTX_EXPORT.

◆ getType()

virtual gzType * ctxBackpropTrainer::getType ( ) const
virtual

Reimplemented from ctxTrainer.

◆ getValidations()

gzUInt32 ctxBackpropTrainer::getValidations ( ) const

References CTX_EXPORT.

◆ isComplete()

gzBool ctxBackpropTrainer::isComplete ( ) const
virtual

Implements ctxTrainer.

References CTX_EXPORT.

◆ isPrepared()

gzBool ctxBackpropTrainer::isPrepared ( ) const
virtual

Implements ctxTrainer.

References CTX_EXPORT.

◆ loadCheckpoint()

gzBool ctxBackpropTrainer::loadCheckpoint ( const gzString & url)
virtual

Implements ctxTrainer.

References CTX_EXPORT.

◆ prepare()

gzBool ctxBackpropTrainer::prepare ( )
virtual

Implements ctxTrainer.

References CTX_EXPORT.

◆ prepareNextBatch()

gzBool ctxBackpropTrainer::prepareNextBatch ( )

Prepare the next selected batch, without a parameter update.

References CTX_EXPORT.

◆ saveCheckpoint()

gzBool ctxBackpropTrainer::saveCheckpoint ( const gzString & url) const
virtual

Implements ctxTrainer.

References CTX_EXPORT.

◆ setDropConnect()

gzBool ctxBackpropTrainer::setDropConnect ( gzFloat probability)

Set the training DropConnect probability for subsequent batches.

Requires a prepared session with no pending batch. The value must be finite and in [0, 1]; positive values require compiled mask slots. Preserves parameters, optimizer state, the current sample order and training progress. Checkpoints saved after the call use the new value.

References CTX_EXPORT.

◆ setOptimizer()

gzBool ctxBackpropTrainer::setOptimizer ( ctxOptimizer * optimizer,
ctxOptimizerStatePolicy statePolicy = CTX_OPTIMIZER_STATE_RESET )

◆ train()

gzBool ctxBackpropTrainer::train ( )
virtual

Reimplemented from ctxTrainer.

References CTX_EXPORT.

◆ trainPreparedBatch()

gzBool ctxBackpropTrainer::trainPreparedBatch ( )

Train one prepared batch and commit its batch/epoch progress.

References CTX_EXPORT.

◆ trainStep()

gzBool ctxBackpropTrainer::trainStep ( )
virtual

Prepare and train the next bounded unit; Backprop consumes one batch.

Implements ctxTrainer.

References CTX_EXPORT.

◆ ctxModel

friend class ctxModel
friend

Definition at line 243 of file ctxCortexTrainer.h.

References ctxBackpropTrainer(), and ctxModel.

Referenced by ctxModel.


The documentation for this class was generated from the following file: