org.joone.engine
Class ExtendableLearner
- java.lang.Object
-
- org.joone.engine.AbstractLearner
-
- org.joone.engine.ExtendableLearner
-
- All Implemented Interfaces:
- java.io.Serializable, Learner
- Direct Known Subclasses:
- BasicLearner, BatchLearner, RpropLearner
public class ExtendableLearner extends AbstractLearner
Learners that extend this class are forced to implement certain functions, a so-called skeleton. The good thing is, because learners extend this class certain plug-ins can be added. For example, plug ins that change the objective function, or the delta-update rule. Still learners that do not fit into this skeleton have to opportunity to implement Learner directly (or extend AbstractLearner), but it won't be able to use the extra plug-ins (unless it is build in the learner by the programmer itself). Basically, this class is the BasicLearner, but by adding extenders it can provide totally different learning algoriths.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description ExtendableLearner()Creates a new instance of ExtendableLearner
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddDeltaRuleExtender(DeltaRuleExtender aDeltaRuleExtender)Adds a delta extender.voidaddGradientExtender(GradientExtender aGradientExtender)Adds a gradient extender.doublegetDefaultDelta(double[] currentGradientOuts, int j)Gets the default (normal calculation of) delta.doublegetDefaultDelta(double[] currentInps, int j, double[] currentPattern, int k)Gets the default (normal calculation of) delta.doublegetDefaultGradientBias(double[] currentGradientOuts, int j)Gets the default (normal calculation of the) gradient for biases.doublegetDefaultGradientWeight(double[] currentInps, int j, double[] currentPattern, int k)Gets the default (normal calculation of the) gradient for weights.doublegetGradientBias(double[] currentGradientOuts, int j)Gets the gradient for biases.doublegetGradientWeight(double[] currentInps, int j, double[] currentPattern, int k)Gets the gradient for weights.UpdateWeightExtendergetUpdateWeightExtender()Gets the update weight extender.voidrequestBiasUpdate(double[] currentGradientOuts)Override this method to implement what should be done to LearnableLayersvoidrequestWeightUpdate(double[] currentPattern, double[] currentInps)Override this method to implement what should be done to LearnableSynapsesvoidsetUpdateWeightExtender(UpdateWeightExtender anUpdateWeightExtender)Sets an update weight extender.-
Methods inherited from class org.joone.engine.AbstractLearner
getLayer, getMonitor, getSynapse, registerLearnable, setMonitor
-
-
-
-
Constructor Detail
-
ExtendableLearner
public ExtendableLearner()
Creates a new instance of ExtendableLearner
-
-
Method Detail
-
requestBiasUpdate
public final void requestBiasUpdate(double[] currentGradientOuts)
Description copied from interface:LearnerOverride this method to implement what should be done to LearnableLayers
-
requestWeightUpdate
public final void requestWeightUpdate(double[] currentPattern, double[] currentInps)Description copied from interface:LearnerOverride this method to implement what should be done to LearnableSynapses
-
getDefaultDelta
public double getDefaultDelta(double[] currentGradientOuts, int j)Gets the default (normal calculation of) delta.- Parameters:
currentGradientOuts- the back propagated gradients.j- the index of the bias.
-
getDefaultDelta
public double getDefaultDelta(double[] currentInps, int j, double[] currentPattern, int k)Gets the default (normal calculation of) delta.- Parameters:
currentInps- the forwarded input.j- the input index of the weight.currentPattern- the back propagated gradients.k- the output index of the weight.
-
getGradientBias
public double getGradientBias(double[] currentGradientOuts, int j)Gets the gradient for biases.- Parameters:
currentGradientOuts- the back protected gradients.j- the index of the bias.- Returns:
- the gradient for bias b_i.
-
getDefaultGradientBias
public double getDefaultGradientBias(double[] currentGradientOuts, int j)Gets the default (normal calculation of the) gradient for biases.- Parameters:
currentGradientOuts- the back protected gradients.j- the index of the bias.- Returns:
- the gradient for bias b_i.
-
getGradientWeight
public double getGradientWeight(double[] currentInps, int j, double[] currentPattern, int k)Gets the gradient for weights.- Parameters:
aCurrentInps- the forwarded input.j- the input index of the weight.currentPattern- the back propagated gradients.k- the output index of the weight.- Returns:
- the gradient for the weight w_j_k
-
getDefaultGradientWeight
public double getDefaultGradientWeight(double[] currentInps, int j, double[] currentPattern, int k)Gets the default (normal calculation of the) gradient for weights.- Parameters:
aCurrentInps- the forwarded input.j- the input index of the weight.currentPattern- the back propagated gradients.k- the output index of the weight.- Returns:
- the gradient for the weight w_j_k
-
addDeltaRuleExtender
public void addDeltaRuleExtender(DeltaRuleExtender aDeltaRuleExtender)
Adds a delta extender.- Parameters:
aDeltaRuleExtender- the delta rule extender to add.
-
addGradientExtender
public void addGradientExtender(GradientExtender aGradientExtender)
Adds a gradient extender.- Parameters:
aGradientExtender- the gradient extender to add.
-
setUpdateWeightExtender
public void setUpdateWeightExtender(UpdateWeightExtender anUpdateWeightExtender)
Sets an update weight extender.- Parameters:
anUpdateWeightExtender- the update weight extender to set.
-
getUpdateWeightExtender
public UpdateWeightExtender getUpdateWeightExtender()
Gets the update weight extender.- Returns:
- the update weight extender.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG