Package ml.shifu.guagua.example.nn.meta
Class NNParams
- java.lang.Object
-
- ml.shifu.guagua.io.HaltBytable
-
- ml.shifu.guagua.example.nn.meta.NNParams
-
- All Implemented Interfaces:
ml.shifu.guagua.io.Bytable
public class NNParams extends ml.shifu.guagua.io.HaltBytableNNParams are used to save NN model info which can also be stored into ZooKeeper.weightsis used to set model weights which is used to transfer info from master to workers.gradientsis used to accumulate all workers' gradients together in master and then use the accumulated gradients to update neural network weights.
-
-
Constructor Summary
Constructors Constructor Description NNParams()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccumulateGradients(double[] gradients)voidaccumulateTrainSize(long size)voiddoReadFields(DataInput in)voiddoWrite(DataOutput out)double[]getGradients()doublegetTestError()doublegetTrainError()longgetTrainSize()double[]getWeights()voidreset()voidsetGradients(double[] gradients)voidsetTestError(double testError)voidsetTrainError(double trainError)voidsetTrainSize(long trainSize)voidsetWeights(double[] weights)StringtoString()
-
-
-
Method Detail
-
getWeights
public double[] getWeights()
-
setWeights
public void setWeights(double[] weights)
-
getTestError
public double getTestError()
-
setTestError
public void setTestError(double testError)
-
getTrainError
public double getTrainError()
-
setTrainError
public void setTrainError(double trainError)
-
accumulateGradients
public void accumulateGradients(double[] gradients)
-
getGradients
public double[] getGradients()
- Returns:
- the gradients
-
setGradients
public void setGradients(double[] gradients)
- Parameters:
gradients- the gradients to set
-
getTrainSize
public long getTrainSize()
-
setTrainSize
public void setTrainSize(long trainSize)
-
accumulateTrainSize
public void accumulateTrainSize(long size)
-
reset
public void reset()
-
doWrite
public void doWrite(DataOutput out) throws IOException
- Specified by:
doWritein classml.shifu.guagua.io.HaltBytable- Throws:
IOException
-
doReadFields
public void doReadFields(DataInput in) throws IOException
- Specified by:
doReadFieldsin classml.shifu.guagua.io.HaltBytable- Throws:
IOException
-
-