ml.shifu.guagua.example.lr
类 LogisticRegressionWorker
java.lang.Object
ml.shifu.guagua.worker.AbstractWorkerComputable<LogisticRegressionParams,LogisticRegressionParams,GuaguaWritableAdapter<org.apache.hadoop.io.LongWritable>,GuaguaWritableAdapter<org.apache.hadoop.io.Text>>
ml.shifu.guagua.example.lr.LogisticRegressionWorker
- 所有已实现的接口:
- ml.shifu.guagua.worker.WorkerComputable<LogisticRegressionParams,LogisticRegressionParams>
public class LogisticRegressionWorker
- extends ml.shifu.guagua.worker.AbstractWorkerComputable<LogisticRegressionParams,LogisticRegressionParams,GuaguaWritableAdapter<org.apache.hadoop.io.LongWritable>,GuaguaWritableAdapter<org.apache.hadoop.io.Text>>
LogisticRegressionWorker defines logic to accumulate local logistic regression gradients.
At first iteration, wait for master to use the consistent initiating model.
At other iterations, workers include:
- 1. Update local model by using global model from last step..
- 2. Accumulate gradients by using local worker input data.
- 3. Send new local gradients to master by returning parameters.
| 从类 ml.shifu.guagua.worker.AbstractWorkerComputable 继承的方法 |
compute, getRecordReader, preLoad, setRecordReader |
| 从类 java.lang.Object 继承的方法 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LogisticRegressionWorker
public LogisticRegressionWorker()
initRecordReader
public void initRecordReader(ml.shifu.guagua.io.GuaguaFileSplit fileSplit)
throws IOException
- 指定者:
- 类
ml.shifu.guagua.worker.AbstractWorkerComputable<LogisticRegressionParams,LogisticRegressionParams,GuaguaWritableAdapter<org.apache.hadoop.io.LongWritable>,GuaguaWritableAdapter<org.apache.hadoop.io.Text>> 中的 initRecordReader
- 抛出:
IOException
init
public void init(ml.shifu.guagua.worker.WorkerContext<LogisticRegressionParams,LogisticRegressionParams> context)
- 指定者:
- 类
ml.shifu.guagua.worker.AbstractWorkerComputable<LogisticRegressionParams,LogisticRegressionParams,GuaguaWritableAdapter<org.apache.hadoop.io.LongWritable>,GuaguaWritableAdapter<org.apache.hadoop.io.Text>> 中的 init
doCompute
public LogisticRegressionParams doCompute(ml.shifu.guagua.worker.WorkerContext<LogisticRegressionParams,LogisticRegressionParams> context)
- 指定者:
- 类
ml.shifu.guagua.worker.AbstractWorkerComputable<LogisticRegressionParams,LogisticRegressionParams,GuaguaWritableAdapter<org.apache.hadoop.io.LongWritable>,GuaguaWritableAdapter<org.apache.hadoop.io.Text>> 中的 doCompute
postLoad
protected void postLoad(ml.shifu.guagua.worker.WorkerContext<LogisticRegressionParams,LogisticRegressionParams> context)
- 覆盖:
- 类
ml.shifu.guagua.worker.AbstractWorkerComputable<LogisticRegressionParams,LogisticRegressionParams,GuaguaWritableAdapter<org.apache.hadoop.io.LongWritable>,GuaguaWritableAdapter<org.apache.hadoop.io.Text>> 中的 postLoad
load
public void load(GuaguaWritableAdapter<org.apache.hadoop.io.LongWritable> currentKey,
GuaguaWritableAdapter<org.apache.hadoop.io.Text> currentValue,
ml.shifu.guagua.worker.WorkerContext<LogisticRegressionParams,LogisticRegressionParams> context)
- 指定者:
- 类
ml.shifu.guagua.worker.AbstractWorkerComputable<LogisticRegressionParams,LogisticRegressionParams,GuaguaWritableAdapter<org.apache.hadoop.io.LongWritable>,GuaguaWritableAdapter<org.apache.hadoop.io.Text>> 中的 load
Copyright © 2015. All Rights Reserved.