Skip to content

Commit

Permalink
Add comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
reyoung committed Dec 22, 2016
1 parent 16ea66e commit 3a80272
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions paddle/api/PaddleAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -799,22 +799,61 @@ class ParameterUpdater {
static ParameterUpdater* createLocalUpdater(OptimizationConfig* config);
~ParameterUpdater();

/**
* @brief initialize Parameter Updater by GradientMachine.
* @param gm
*/
void init(const GradientMachine& gm);

/**
* @brief begin of a training/testing of one pass.
*/
void startPass();

/**
* @brief end of a traning/testing of one pass.
*/
void finishPass();

/**
* @brief begin of a training/testing of one batch.
* @param data batch's size
* @return PassType, mostly will be training.
*/
PassType startBatch(size_t batchSize);

/**
* @brief end of a traning/testing of one batch
* @param cost current batch cost.
*/
void finishBatch(float cost);

/**
* @brief update a parameter (by local optimizer or by cluster pserver)
* @param param
*/
void update(Parameter* param);

/**
* @brief restore the average parameter.
* @note It is only used in AverageOptimizer. Restore will get the current
* PARAMETER_VALUE back.
*/
void restore();

/**
* @brief apply. Store the average parameter.
* @note It is only used in AverageOptimizer. Apply will store the current
* PARAMETER_VALUE to buffer, calcaualte current Average Parameter, and save
* it to PARAMETER_VALUE.
*/
void apply();

/**
* @brief catchUpWith The Regularization will be delayed in many situations(
* pserver, local sparse). Catch Up means catch the regularization up, apply
* regularization to all params.
*/
void catchUpWith();

private:
Expand All @@ -830,10 +869,21 @@ class Evaluator {
public:
~Evaluator();

/**
* @brief begin an evaluate stage.
*/
void start();

/**
* @brief end an evaluate stage.
*/
void finish();

/**
* @brief toString will get a evaluate result.
*
* __repr__ method in python
*/
std::string toString();

private:
Expand Down

0 comments on commit 3a80272

Please sign in to comment.