org.joone.engine.extenders
Class BatchModeExtender
- java.lang.Object
-
- org.joone.engine.extenders.LearnerExtender
-
- org.joone.engine.extenders.UpdateWeightExtender
-
- org.joone.engine.extenders.BatchModeExtender
-
public class BatchModeExtender extends UpdateWeightExtender
This class implements the offline learning, that is, batch mode. Weights are updated after Monitor.getBatchSize() cycles.
-
-
Constructor Summary
Constructors Constructor and Description BatchModeExtender()Creates a new instance of BatchModeExtender
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description intgetBatchSize()Deprecated.use monitor.getBatchSize()voidpostBiasUpdate(double[] currentGradientOuts)Gives extenders a change to do some post-computing after the biases are updated.voidpostWeightUpdate(double[] currentPattern, double[] currentInps)Gives extenders a change to do some post-computing after the weights are updated.voidpreBiasUpdate(double[] currentGradientOuts)Gives extenders a change to do some pre-computing before the biases are updated.voidpreWeightUpdate(double[] currentPattern, double[] currentInps)Gives extenders a change to do some pre-computing before the weights are updated.voidsetBatchSize(int aBatchSize)Deprecated.use monitor.setBatchSize()booleanstoreWeightsBiases()Checks if the weights or biases will be stored this cycle.voidupdateBias(int i, double aDelta)Updates a bias with the calculated delta value.voidupdateWeight(int j, int k, double aDelta)Updates a weight with the calculated delta value.-
Methods inherited from class org.joone.engine.extenders.LearnerExtender
isEnabled, setEnabled, setLearner
-
-
-
-
Constructor Detail
-
BatchModeExtender
public BatchModeExtender()
Creates a new instance of BatchModeExtender
-
-
Method Detail
-
postBiasUpdate
public void postBiasUpdate(double[] currentGradientOuts)
Description copied from class:LearnerExtenderGives extenders a change to do some post-computing after the biases are updated.- Specified by:
postBiasUpdatein classLearnerExtender- Parameters:
currentGradientOuts- the back propagated gradients.
-
postWeightUpdate
public void postWeightUpdate(double[] currentPattern, double[] currentInps)Description copied from class:LearnerExtenderGives extenders a change to do some post-computing after the weights are updated.- Specified by:
postWeightUpdatein classLearnerExtender- Parameters:
currentPattern- the back propagated gradients.currentInps- the forwarded input.
-
preBiasUpdate
public void preBiasUpdate(double[] currentGradientOuts)
Description copied from class:LearnerExtenderGives extenders a change to do some pre-computing before the biases are updated.- Specified by:
preBiasUpdatein classLearnerExtender- Parameters:
currentGradientOuts- the back propagated gradients.
-
preWeightUpdate
public void preWeightUpdate(double[] currentPattern, double[] currentInps)Description copied from class:LearnerExtenderGives extenders a change to do some pre-computing before the weights are updated.- Specified by:
preWeightUpdatein classLearnerExtender- Parameters:
currentPattern- the back propagated gradients.currentInps- the forwarded input.
-
updateBias
public void updateBias(int i, double aDelta)Description copied from class:UpdateWeightExtenderUpdates a bias with the calculated delta value.- Specified by:
updateBiasin classUpdateWeightExtender- Parameters:
i- the index of the bias to update.aDelta- the calculated delta value.
-
updateWeight
public void updateWeight(int j, int k, double aDelta)Description copied from class:UpdateWeightExtenderUpdates a weight with the calculated delta value.- Specified by:
updateWeightin classUpdateWeightExtender- Parameters:
j- the input index of the weight to update.k- the output index of the weight to update.aDelta- the calculated delta value.
-
setBatchSize
public void setBatchSize(int aBatchSize)
Deprecated. use monitor.setBatchSize()Sets the batchsize. Used for backward compatibility. Use monitor.setBatchSize() instead.- Parameters:
aBatchSize- the new batchsize.
-
getBatchSize
public int getBatchSize()
Deprecated. use monitor.getBatchSize()Gets the batchsize. Used for backward compatibility. Use monitor.getBatchSize() instead.- Returns:
- the batch size.
-
storeWeightsBiases
public boolean storeWeightsBiases()
Description copied from class:UpdateWeightExtenderChecks if the weights or biases will be stored this cycle.- Specified by:
storeWeightsBiasesin classUpdateWeightExtender- Returns:
- true if the weights or biases will be stored this cycle, false otherwise.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG