Skip to content

Commit 3a80272

Browse files
committed
Add comments.
1 parent 16ea66e commit 3a80272

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

paddle/api/PaddleAPI.h

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,22 +799,61 @@ class ParameterUpdater {
799799
static ParameterUpdater* createLocalUpdater(OptimizationConfig* config);
800800
~ParameterUpdater();
801801

802+
/**
803+
* @brief initialize Parameter Updater by GradientMachine.
804+
* @param gm
805+
*/
802806
void init(const GradientMachine& gm);
803807

808+
/**
809+
* @brief begin of a training/testing of one pass.
810+
*/
804811
void startPass();
805812

813+
/**
814+
* @brief end of a traning/testing of one pass.
815+
*/
806816
void finishPass();
807817

818+
/**
819+
* @brief begin of a training/testing of one batch.
820+
* @param data batch's size
821+
* @return PassType, mostly will be training.
822+
*/
808823
PassType startBatch(size_t batchSize);
809824

825+
/**
826+
* @brief end of a traning/testing of one batch
827+
* @param cost current batch cost.
828+
*/
810829
void finishBatch(float cost);
811830

831+
/**
832+
* @brief update a parameter (by local optimizer or by cluster pserver)
833+
* @param param
834+
*/
812835
void update(Parameter* param);
813836

837+
/**
838+
* @brief restore the average parameter.
839+
* @note It is only used in AverageOptimizer. Restore will get the current
840+
* PARAMETER_VALUE back.
841+
*/
814842
void restore();
815843

844+
/**
845+
* @brief apply. Store the average parameter.
846+
* @note It is only used in AverageOptimizer. Apply will store the current
847+
* PARAMETER_VALUE to buffer, calcaualte current Average Parameter, and save
848+
* it to PARAMETER_VALUE.
849+
*/
816850
void apply();
817851

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

820859
private:
@@ -830,10 +869,21 @@ class Evaluator {
830869
public:
831870
~Evaluator();
832871

872+
/**
873+
* @brief begin an evaluate stage.
874+
*/
833875
void start();
834876

877+
/**
878+
* @brief end an evaluate stage.
879+
*/
835880
void finish();
836881

882+
/**
883+
* @brief toString will get a evaluate result.
884+
*
885+
* __repr__ method in python
886+
*/
837887
std::string toString();
838888

839889
private:

0 commit comments

Comments
 (0)