Package ml.shifu.guagua.example.lr
Class LogisticRegressionMaster
- java.lang.Object
-
- ml.shifu.guagua.master.AbstractMasterComputable<LogisticRegressionParams,LogisticRegressionParams>
-
- ml.shifu.guagua.example.lr.LogisticRegressionMaster
-
- All Implemented Interfaces:
ml.shifu.guagua.master.MasterComputable<LogisticRegressionParams,LogisticRegressionParams>
public class LogisticRegressionMaster extends ml.shifu.guagua.master.AbstractMasterComputable<LogisticRegressionParams,LogisticRegressionParams>
LogisticRegressionMasterdefines logic to update global logistic regression model.At first iteration, master builds a random model then send to all workers to start computing. This is to make all workers use the same model at the starting time.
At other iterations, master works:
- 1. Accumulate all gradients from workers.
- 2. Update global models by using accumulated gradients.
- 3. Send new global model to workers by returning model parameters.
-
-
Constructor Summary
Constructors Constructor Description LogisticRegressionMaster()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LogisticRegressionParamsdoCompute(ml.shifu.guagua.master.MasterContext<LogisticRegressionParams,LogisticRegressionParams> context)voidinit(ml.shifu.guagua.master.MasterContext<LogisticRegressionParams,LogisticRegressionParams> context)
-
-
-
Method Detail
-
init
public void init(ml.shifu.guagua.master.MasterContext<LogisticRegressionParams,LogisticRegressionParams> context)
- Specified by:
initin classml.shifu.guagua.master.AbstractMasterComputable<LogisticRegressionParams,LogisticRegressionParams>
-
doCompute
public LogisticRegressionParams doCompute(ml.shifu.guagua.master.MasterContext<LogisticRegressionParams,LogisticRegressionParams> context)
- Specified by:
doComputein classml.shifu.guagua.master.AbstractMasterComputable<LogisticRegressionParams,LogisticRegressionParams>
-
-