@@ -799,22 +799,61 @@ class ParameterUpdater {
799
799
static ParameterUpdater* createLocalUpdater (OptimizationConfig* config);
800
800
~ParameterUpdater ();
801
801
802
+ /* *
803
+ * @brief initialize Parameter Updater by GradientMachine.
804
+ * @param gm
805
+ */
802
806
void init (const GradientMachine& gm);
803
807
808
+ /* *
809
+ * @brief begin of a training/testing of one pass.
810
+ */
804
811
void startPass ();
805
812
813
+ /* *
814
+ * @brief end of a traning/testing of one pass.
815
+ */
806
816
void finishPass ();
807
817
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
+ */
808
823
PassType startBatch (size_t batchSize);
809
824
825
+ /* *
826
+ * @brief end of a traning/testing of one batch
827
+ * @param cost current batch cost.
828
+ */
810
829
void finishBatch (float cost);
811
830
831
+ /* *
832
+ * @brief update a parameter (by local optimizer or by cluster pserver)
833
+ * @param param
834
+ */
812
835
void update (Parameter* param);
813
836
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
+ */
814
842
void restore ();
815
843
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
+ */
816
850
void apply ();
817
851
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
+ */
818
857
void catchUpWith ();
819
858
820
859
private:
@@ -830,10 +869,21 @@ class Evaluator {
830
869
public:
831
870
~Evaluator ();
832
871
872
+ /* *
873
+ * @brief begin an evaluate stage.
874
+ */
833
875
void start ();
834
876
877
+ /* *
878
+ * @brief end an evaluate stage.
879
+ */
835
880
void finish ();
836
881
882
+ /* *
883
+ * @brief toString will get a evaluate result.
884
+ *
885
+ * __repr__ method in python
886
+ */
837
887
std::string toString ();
838
888
839
889
private:
0 commit comments